Skip to content

Commit

Permalink
fix:修复定时任务的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tahitimoon committed May 20, 2024
1 parent 93e8cc5 commit cb5dc27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/apps/lunarlink/utils/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ def update_task(self, task_id):
:return:
"""
self.format_crontab()
task_obj = celery_models.PeriodicTask.objects.filter(id=task_id)
if not task_obj:
try:
task_obj = celery_models.PeriodicTask.objects.get(id=task_id)
except celery_models.PeriodicTask.DoesNotExist:
raise TaskNotFound

crontab = celery_models.CrontabSchedule.objects.filter(
Expand Down

0 comments on commit cb5dc27

Please sign in to comment.