75499efe by 冯轩

FIX:调整原流程只处理排队中的情况

1 parent d619642f
......@@ -144,11 +144,11 @@ class Command(BaseCommand, LoggerMixin):
if doc is None:
self.online_log.warn('{0} [get_doc_info] [doc not exist] [task_str={1}] [is_priority={2}]'.format(
self.log_base, task_str, is_priority))
return None, None, None, None
elif doc.status != DocStatus.INIT.value:
return None, None, None, None, None
elif doc.status != DocStatus.INIT.value or (re_ocr_flag == 'Y' and doc.status != DocStatus.PROCESS_FAILED.value):
self.online_log.warn('{0} [get_doc_info] [doc status error] [task_str={1}] [is_priority={2}] '
'[doc_status={3}]'.format(self.log_base, task_str, is_priority, doc.status))
return None, None, None, None
return None, None, None, None, None
doc.status = DocStatus.PROCESSING.value
doc.start_time = timezone.now()
doc.save()
......@@ -158,8 +158,8 @@ class Command(BaseCommand, LoggerMixin):
self.log_base, traceback.format_exc()))
raise e
else:
self.online_log.info('{0} [get_doc_info] [db save end] [task_str={1}] [is_priority={2}]'.format(
self.log_base, task_str, is_priority))
self.online_log.info('{0} [get_doc_info] [db save end] [task_str={1}] [is_priority={2}] [re_ocr_flag={3}]'.format(
self.log_base, task_str, is_priority, re_ocr_flag))
return doc, business_type, rebuild_task_str, classify_1_str, re_ocr_flag
# def pdf_download(self, doc, pdf_path):
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!