76581bb1 by 周伟奇

add delay GCAP

1 parent 381cf7e0
import json
import time
import logging
import traceback
from datetime import datetime, timedelta
from collections import OrderedDict
from . import app
from apps.doc.models import AFCOCRResult, HILOCRResult, AFCComparisonInfo, HILComparisonInfo
......@@ -157,6 +159,13 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
'[compare_res={5}]'.format(log_base, application_entity, application_id, uniq_seq,
ocr_res_id, comparison_res))
# 时间延迟
send_time = last_obj.create_time + timedelta(seconds=15)
while datetime.now() < send_time:
compare_log.info('{0} [time wait 5s] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}]'.format(
log_base, application_entity, application_id, uniq_seq, ocr_res_id))
time.sleep(5)
# 将比对结果发送GCAP
try:
data = gcap.dict_to_xml(comparison_res)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!