wf run task 优化
This commit is contained in:
parent
839e11b575
commit
0981700f30
|
@ -181,7 +181,7 @@ class HrmService:
|
||||||
}
|
}
|
||||||
is_ok, res = dhClient.request(**dhapis['card_door_authority'], json=json_data, raise_exception=False)
|
is_ok, res = dhClient.request(**dhapis['card_door_authority'], json=json_data, raise_exception=False)
|
||||||
if is_ok == 'fail' and '44999999' in res['code']:
|
if is_ok == 'fail' and '44999999' in res['code']:
|
||||||
time.sleep(10)
|
time.sleep(14)
|
||||||
dhClient.request(**dhapis['card_door_authority'], json=json_data)
|
dhClient.request(**dhapis['card_door_authority'], json=json_data)
|
||||||
elif is_ok == 'fail':
|
elif is_ok == 'fail':
|
||||||
raise ParseError(**res)
|
raise ParseError(**res)
|
||||||
|
|
|
@ -48,8 +48,9 @@ def run_task(ticket_id: str, retry_num=1):
|
||||||
except Exception:
|
except Exception:
|
||||||
retry_num_new = retry_num - 1
|
retry_num_new = retry_num - 1
|
||||||
if retry_num_new >= 0:
|
if retry_num_new >= 0:
|
||||||
time.sleep(10)
|
time.sleep(5)
|
||||||
run_task(ticket_id, retry_num_new)
|
run_task.delay(ticket_id, retry_num_new)
|
||||||
|
return
|
||||||
err_detail = traceback.format_exc()
|
err_detail = traceback.format_exc()
|
||||||
myLogger.error('工作流脚本执行失败', exc_info=True)
|
myLogger.error('工作流脚本执行失败', exc_info=True)
|
||||||
script_result = False
|
script_result = False
|
||||||
|
|
Loading…
Reference in New Issue