fix try catch
Showing
1 changed file
with
27 additions
and
28 deletions
... | @@ -3772,38 +3772,37 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, | ... | @@ -3772,38 +3772,37 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, |
3772 | except Exception as e: | 3772 | except Exception as e: |
3773 | compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc())) | 3773 | compare_log.info('[sleep error] [error={0}]'.format(traceback.format_exc())) |
3774 | 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)) | 3774 | 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)) |
3775 | except Exception as e: | ||
3776 | compare_log.info('[fsm_compare_thread error] [error={0}]'.format(traceback.format_exc())) | ||
3777 | 3775 | ||
3776 | # 调用java fsm 比对流程接口(http) | ||
3777 | # 调用Java fsm 比对流程接口, fsm 是se流程, ca可以暂时忽略 | ||
3778 | auto_class = HILAutoSettlement if application_entity == consts.HIL_PREFIX else AFCAutoSettlement | ||
3779 | auto_obj = auto_class.objects.filter(application_id=application_id, on_off=True).first() | ||
3780 | if auto_obj is not None: | ||
3781 | url = conf.FSM_AUTO_URL | ||
3782 | is_auto = True | ||
3783 | else: | ||
3784 | url = conf.FSM_URL | ||
3785 | is_auto = False | ||
3778 | 3786 | ||
3779 | # 调用java fsm 比对流程接口(http) | 3787 | body = { |
3780 | # 调用Java fsm 比对流程接口, fsm 是se流程, ca可以暂时忽略 | 3788 | 'applicationId': application_id, |
3781 | auto_class = HILAutoSettlement if application_entity == consts.HIL_PREFIX else AFCAutoSettlement | 3789 | 'businessType': application_entity, |
3782 | auto_obj = auto_class.objects.filter(application_id=application_id, on_off=True).first() | 3790 | 'ocrResId': ocr_res_id, |
3783 | if auto_obj is not None: | 3791 | 'isCa': is_ca, |
3784 | url = conf.FSM_AUTO_URL | 3792 | 'isCms': is_cms |
3785 | is_auto = True | ||
3786 | else: | ||
3787 | url = conf.FSM_URL | ||
3788 | is_auto = False | ||
3789 | |||
3790 | body = { | ||
3791 | 'applicationId': application_id, | ||
3792 | 'businessType': application_entity, | ||
3793 | 'ocrResId': ocr_res_id, | ||
3794 | 'isCa': is_ca, | ||
3795 | 'isCms': is_cms | ||
3796 | } | ||
3797 | try: | ||
3798 | compare_log.info("request java fsm api, url:{0}, body:{1}, is_auto:{2}".format(url, json.dumps(body), is_auto)) | ||
3799 | headers = { | ||
3800 | 'Content-Type': 'application/json' | ||
3801 | } | 3793 | } |
3802 | resp = requests.post(url, headers=headers, json=body) | 3794 | try: |
3803 | compare_log.info("response from fsm api, resp:{0}".format(resp.text)) | 3795 | compare_log.info("request java fsm api, url:{0}, body:{1}, is_auto:{2}".format(url, json.dumps(body), is_auto)) |
3796 | headers = { | ||
3797 | 'Content-Type': 'application/json' | ||
3798 | } | ||
3799 | resp = requests.post(url, headers=headers, json=body) | ||
3800 | compare_log.info("response from fsm api, resp:{0}".format(resp.text)) | ||
3801 | except Exception as e: | ||
3802 | compare_log.error("fsm full request to java error, url:{0}, param:{1}, errorMsg:{2}".format( | ||
3803 | url, json.dumps(body), traceback.format_exc())) | ||
3804 | except Exception as e: | 3804 | except Exception as e: |
3805 | compare_log.error("fsm full request to java error, url:{0}, param:{1}, errorMsg:{2}".format( | 3805 | compare_log.info('[fsm_compare_thread error] [error={0}]'.format(traceback.format_exc())) |
3806 | url, json.dumps(body), traceback.format_exc())) | ||
3807 | 3806 | ||
3808 | 3807 | ||
3809 | @app.task | 3808 | @app.task | ... | ... |
-
Please register or sign in to post a comment