From 9ce68c02df03cbcd3f7155c3c100b9956e358c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Fri, 15 Jul 2022 09:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=89=A7=E8=A1=8Cdelay=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/vm/tasks.py | 3 ++- apps/wf/services.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/vm/tasks.py b/apps/vm/tasks.py index e3190f36..9c08b51c 100644 --- a/apps/vm/tasks.py +++ b/apps/vm/tasks.py @@ -10,7 +10,8 @@ from apps.wf.services import WfService @shared_task(base=CustomTask) -def visit_exec(ticket, script_str): +def visit_exec(ticket_id, script_str): + ticket = Ticket.objects.get(id=ticket_id) ticket.script_run_last_result = False ticket.save() visit = Visit.objects.get(ticket=ticket) diff --git a/apps/wf/services.py b/apps/wf/services.py index e3596c53..ebc840a4 100755 --- a/apps/wf/services.py +++ b/apps/wf/services.py @@ -428,4 +428,4 @@ class WfService(object): module, func = state.participant.rsplit(".", 1) m = importlib.import_module(module) f = getattr(m, func) - f.delay(ticket=ticket, script_str=state.participant) # 里面要加入回调才能继续流转 + f.delay(ticket_id=ticket.id, script_str=state.participant) # 里面要加入回调才能继续流转