wf run task 优化

This commit is contained in:
caoqianming 2022-11-14 10:39:08 +08:00
parent 839e11b575
commit 0981700f30
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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