From 0981700f3061ee75df01bc843034b9c4aa2e77a8 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 14 Nov 2022 10:39:08 +0800 Subject: [PATCH] =?UTF-8?q?wf=20run=20task=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/services.py | 2 +- apps/wf/tasks.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/hrm/services.py b/apps/hrm/services.py index 4adddaf7..8ffa61cc 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -181,7 +181,7 @@ class HrmService: } is_ok, res = dhClient.request(**dhapis['card_door_authority'], json=json_data, raise_exception=False) if is_ok == 'fail' and '44999999' in res['code']: - time.sleep(10) + time.sleep(14) dhClient.request(**dhapis['card_door_authority'], json=json_data) elif is_ok == 'fail': raise ParseError(**res) diff --git a/apps/wf/tasks.py b/apps/wf/tasks.py index 380b096b..7352542b 100644 --- a/apps/wf/tasks.py +++ b/apps/wf/tasks.py @@ -48,8 +48,9 @@ def run_task(ticket_id: str, retry_num=1): except Exception: retry_num_new = retry_num - 1 if retry_num_new >= 0: - time.sleep(10) - run_task(ticket_id, retry_num_new) + time.sleep(5) + run_task.delay(ticket_id, retry_num_new) + return err_detail = traceback.format_exc() myLogger.error('工作流脚本执行失败', exc_info=True) script_result = False