fix: 定时任务,再次执行报错

pull/13236/head
wangruidong 2024-05-16 15:45:19 +08:00 committed by Bryan
parent d4c1f93ef6
commit a11097fb5a
1 changed files with 2 additions and 0 deletions

View File

@ -262,6 +262,8 @@ class CeleryTaskExecutionViewSet(CommonApiMixin, viewsets.ModelViewSet):
msg = _("Task {} not found").format(execution.name)
raise JMSException(code='task_not_found_error', detail=msg)
try:
execution.kwargs.pop('__current_lang', None)
execution.kwargs.pop('__current_org_id', None)
t = task.delay(*execution.args, **execution.kwargs)
except TypeError:
msg = _("Task {} args or kwargs error").format(execution.name)