Skip to content

Commit

Permalink
立即归档逻辑传参错误修改
Browse files Browse the repository at this point in the history
  • Loading branch information
woshiyanghai committed Sep 19, 2024
1 parent 2f0d0f4 commit 1bb9606
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sql/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,5 +535,5 @@ def archive_switch(request):
def archive_once(request):
"""单次立即调用归档任务"""
archive_id = request.GET.get("archive_id")
archive.apply_async(archive_id) # 使用 Celery 的apply_async方法调度任务
archive.apply_async(args=[archive_id]) # 使用 Celery 的apply_async方法调度任务
return JsonResponse({"status": 0, "msg": "ok", "data": {}})
5 changes: 4 additions & 1 deletion sql/utils/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def del_schedule(name):


def task_info(name):
"""获取定时任务详情"""
"""
获取定时任务详情
如果未使用celery beat实现的定时任务,这里无法获取到对应的结果,只会返回一个None
"""
try:
periodic_task = PeriodicTask.objects.get(name=name)
return periodic_task
Expand Down

0 comments on commit 1bb9606

Please sign in to comment.