Update tool_task.py

pull/632/head
Mr Chen 6 months ago
parent 315a3759c3
commit b83e632328
  1. 5
      plugins/rsyncd/tool_task.py

@ -42,7 +42,7 @@ def getTaskConf():
def getConfigData(): def getConfigData():
conf = getTaskConf() conf = getTaskConf()
if os.path.exists(conf): if os.path.exists(conf):
return json.loads(mw.readFile(getTaskConf())) return json.loads(mw.readFile(conf))
return [] return []
@ -69,8 +69,7 @@ def createBgTaskByName(name, args):
return True return True
if "task_id" in cfg.keys() and cfg["task_id"] > 0: if "task_id" in cfg.keys() and cfg["task_id"] > 0:
res = mw.M("crontab").field("id, name").where( res = mw.M("crontab").field("id, name").where("id=?", (cfg["task_id"],)).find()
"id=?", (cfg["task_id"],)).find()
if res and res["id"] == cfg["task_id"]: if res and res["id"] == cfg["task_id"]:
print("计划任务已经存在!") print("计划任务已经存在!")
return True return True

Loading…
Cancel
Save