From 954f86f8a9ef80fc9fa09b1084d973610eb182bd Mon Sep 17 00:00:00 2001 From: Bai Date: Wed, 14 Jun 2023 19:52:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/ops/tasks.py b/apps/ops/tasks.py index 11ad27aa4..1fe0fbe7c 100644 --- a/apps/ops/tasks.py +++ b/apps/ops/tasks.py @@ -64,7 +64,13 @@ def job_execution_task_activity_callback(self, execution_id, *args, **kwargs): activity_callback=job_execution_task_activity_callback ) def run_ops_job_execution(execution_id, **kwargs): - execution = get_object_or_none(JobExecution, id=execution_id) + with tmp_to_root_org(): + execution = get_object_or_none(JobExecution, id=execution_id) + + if not execution: + logger.error("Did not get the execution: {}".format(execution_id)) + return + try: with tmp_to_org(execution.org): execution.start()