diff options
| author | handingkang <[email protected]> | 2024-05-27 14:52:06 +0800 |
|---|---|---|
| committer | handingkang <[email protected]> | 2024-05-27 14:52:06 +0800 |
| commit | 402e8dc0bf373ca3bd4b10af090814fd880a15c3 (patch) | |
| tree | fa78ca32367b5bd8584899b2b1935b125510126b | |
| parent | 6d67e4a623687baa87365984649bbc33cd11c271 (diff) | |
1. 修复任务删除接口错误
| -rw-r--r-- | server/apps/task.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/apps/task.py b/server/apps/task.py index 5f83954..f31e700 100644 --- a/server/apps/task.py +++ b/server/apps/task.py @@ -409,6 +409,19 @@ def taskpolicy_log(query_data): }) def del_task(json_data): taskid = json_data["id"] + # 首先删除所有有关联的执行策略 + policysql = """ + DELETE + FROM %s + WHERE FOR_TASK='%s' + """ % (MYSQL_TAB_TASKPOLICY, taskid) + try: + da.cursor.execute(policysql) + da.conn.commit() + except Exception as e: + error(str(e)) + return {"code": 500, "msg": str(e)} + # 删除任务记录 sql = """ DELETE FROM %s |
