Skip to content

Commit

Permalink
修改遗漏的task_job
Browse files Browse the repository at this point in the history
  • Loading branch information
woshiyanghai committed Sep 19, 2024
1 parent edbbe57 commit f174b62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
7 changes: 0 additions & 7 deletions sql/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,6 @@ def add_archive_task(archive_ids=None):
# 添加task任务
for archive_info in archive_cnf_list:
archive_id = archive_info.id
async_task(
"sql.archiver.archive",
archive_id,
group=f'archive-{time.strftime("%Y-%m-%d %H:%M:%S ")}',
timeout=-1,
task_name=f"archive-{archive_id}",
)
archive.apply_async(
args=[archive_id],
task_id=f"archive-{archive_id}", # Celery 允许你指定自定义的任务ID
Expand Down
14 changes: 8 additions & 6 deletions sql/sql_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,14 @@ def cancel(request):
else True
)
if is_notified:
async_task(
notify_for_audit,
workflow_audit=auditor.audit,
workflow_audit_detail=workflow_audit_detail,
timeout=60,
task_name=f"sqlreview-cancel-{workflow_id}",
# 异步调用 Celery 任务
notify_for_audit.apply_async(
args=[
auditor.audit.audit_id,
workflow_audit_detail.audit_detail_id,
],
time_limit=60, # 设置此次任务的超时时间为60秒
task_id=f"sqlreview-cancel-{workflow_id}", # 可选,自定义任务ID
)
return HttpResponseRedirect(reverse("sql:detail", args=(workflow_id,)))

Expand Down

0 comments on commit f174b62

Please sign in to comment.