6539e1d1 by 冯轩

fix try catch

1 parent 775d6ee5
......@@ -3772,38 +3772,37 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id,
except Exception as e:
compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc()))
compare_log.info('{0} [comparison unfinished file wait delay_time end] [entity={1}] [id={2}] [doc_id={3}]'.format(log_base, application_entity, application_id, doc_wait_file_result.id))
except Exception as e:
compare_log.info('[fsm_compare_thread error] [error={0}]'.format(traceback.format_exc()))
# 调用java fsm 比对流程接口(http)
# 调用Java fsm 比对流程接口, fsm 是se流程, ca可以暂时忽略
auto_class = HILAutoSettlement if application_entity == consts.HIL_PREFIX else AFCAutoSettlement
auto_obj = auto_class.objects.filter(application_id=application_id, on_off=True).first()
if auto_obj is not None:
url = conf.FSM_AUTO_URL
is_auto = True
else:
url = conf.FSM_URL
is_auto = False
# 调用java fsm 比对流程接口(http)
# 调用Java fsm 比对流程接口, fsm 是se流程, ca可以暂时忽略
auto_class = HILAutoSettlement if application_entity == consts.HIL_PREFIX else AFCAutoSettlement
auto_obj = auto_class.objects.filter(application_id=application_id, on_off=True).first()
if auto_obj is not None:
url = conf.FSM_AUTO_URL
is_auto = True
else:
url = conf.FSM_URL
is_auto = False
body = {
'applicationId': application_id,
'businessType': application_entity,
'ocrResId': ocr_res_id,
'isCa': is_ca,
'isCms': is_cms
}
try:
compare_log.info("request java fsm api, url:{0}, body:{1}, is_auto:{2}".format(url, json.dumps(body), is_auto))
headers = {
'Content-Type': 'application/json'
body = {
'applicationId': application_id,
'businessType': application_entity,
'ocrResId': ocr_res_id,
'isCa': is_ca,
'isCms': is_cms
}
resp = requests.post(url, headers=headers, json=body)
compare_log.info("response from fsm api, resp:{0}".format(resp.text))
try:
compare_log.info("request java fsm api, url:{0}, body:{1}, is_auto:{2}".format(url, json.dumps(body), is_auto))
headers = {
'Content-Type': 'application/json'
}
resp = requests.post(url, headers=headers, json=body)
compare_log.info("response from fsm api, resp:{0}".format(resp.text))
except Exception as e:
compare_log.error("fsm full request to java error, url:{0}, param:{1}, errorMsg:{2}".format(
url, json.dumps(body), traceback.format_exc()))
except Exception as e:
compare_log.error("fsm full request to java error, url:{0}, param:{1}, errorMsg:{2}".format(
url, json.dumps(body), traceback.format_exc()))
compare_log.info('[fsm_compare_thread error] [error={0}]'.format(traceback.format_exc()))
@app.task
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!