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

This commit is contained in:
wangruidong
2024-05-16 15:45:19 +08:00
committed by Bryan
parent d4c1f93ef6
commit a11097fb5a

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)