3c45854a by 冯轩

MOD:cms通知延迟可配置

1 parent 2aeeaa4f
...@@ -3666,8 +3666,16 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res ...@@ -3666,8 +3666,16 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
3666 } 3666 }
3667 } 3667 }
3668 try: 3668 try:
3669 compare_log.info('{0} [SE] [cms sleep 10] [entity={1}] [id={2}] '.format(log_base, application_entity, application_id)) 3669 compare_log.info('{0} [SE] [cms sleep start] [entity={1}] [id={2}] '.format(log_base, application_entity, application_id))
3670 time.sleep(10) 3670 # 实时查询延迟时间
3671 cms_delay_time_config = Configs.objects.filter(id=5).first()
3672 if cms_delay_time_config is None or cms_delay_time is None or not cms_delay_time.isdigit():
3673 cms_delay_time = 0
3674 else:
3675 cms_delay_time = cms_delay_time_config.value
3676 compare_log.info('cms_delay_time:{0}'.format(cms_delay_time))
3677 time.sleep(int(cms_delay_time))
3678 compare_log.info('{0} [SE] [cms sleep end] [entity={1}] [id={2}] '.format(log_base, application_entity, application_id))
3671 response = cms.send(data) # interface_report ocr to cms 3679 response = cms.send(data) # interface_report ocr to cms
3672 except Exception as e: 3680 except Exception as e:
3673 is_success = False 3681 is_success = False
...@@ -3710,9 +3718,10 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, ...@@ -3710,9 +3718,10 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id,
3710 3718
3711 # 实时查询延迟时间 3719 # 实时查询延迟时间
3712 delay_time_config = Configs.objects.filter(id=4).first() 3720 delay_time_config = Configs.objects.filter(id=4).first()
3713 delay_time = delay_time_config.value
3714 if delay_time_config is None or delay_time is None or not delay_time.isdigit(): 3721 if delay_time_config is None or delay_time is None or not delay_time.isdigit():
3715 delay_time = 0 3722 delay_time = 0
3723 else:
3724 delay_time = delay_time_config.value
3716 compare_log.info('delay_time:{0}'.format(delay_time)) 3725 compare_log.info('delay_time:{0}'.format(delay_time))
3717 3726
3718 # 查看此订单号下是否有未完成的文件,如果有,等1分钟 3727 # 查看此订单号下是否有未完成的文件,如果有,等1分钟
...@@ -3770,9 +3779,10 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ ...@@ -3770,9 +3779,10 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
3770 is_ca, is_cms)) 3779 is_ca, is_cms))
3771 # 实时查询延迟时间 3780 # 实时查询延迟时间
3772 delay_time_config = Configs.objects.filter(id=4).first() 3781 delay_time_config = Configs.objects.filter(id=4).first()
3773 delay_time = delay_time_config.value
3774 if delay_time_config is None or delay_time is None or not delay_time.isdigit(): 3782 if delay_time_config is None or delay_time is None or not delay_time.isdigit():
3775 delay_time = 0 3783 delay_time = 0
3784 else:
3785 delay_time = delay_time_config.value
3776 compare_log.info('delay_time:{0}'.format(delay_time)) 3786 compare_log.info('delay_time:{0}'.format(delay_time))
3777 3787
3778 # 查看此订单号下是否有未完成的文件,如果有,等1分钟 3788 # 查看此订单号下是否有未完成的文件,如果有,等1分钟
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!