FIX:调整原流程只处理排队中的情况
Showing
1 changed file
with
5 additions
and
5 deletions
... | @@ -144,11 +144,11 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -144,11 +144,11 @@ class Command(BaseCommand, LoggerMixin): |
144 | if doc is None: | 144 | if doc is None: |
145 | self.online_log.warn('{0} [get_doc_info] [doc not exist] [task_str={1}] [is_priority={2}]'.format( | 145 | self.online_log.warn('{0} [get_doc_info] [doc not exist] [task_str={1}] [is_priority={2}]'.format( |
146 | self.log_base, task_str, is_priority)) | 146 | self.log_base, task_str, is_priority)) |
147 | return None, None, None, None | 147 | return None, None, None, None, None |
148 | elif doc.status != DocStatus.INIT.value: | 148 | elif doc.status != DocStatus.INIT.value or (re_ocr_flag == 'Y' and doc.status != DocStatus.PROCESS_FAILED.value): |
149 | self.online_log.warn('{0} [get_doc_info] [doc status error] [task_str={1}] [is_priority={2}] ' | 149 | self.online_log.warn('{0} [get_doc_info] [doc status error] [task_str={1}] [is_priority={2}] ' |
150 | '[doc_status={3}]'.format(self.log_base, task_str, is_priority, doc.status)) | 150 | '[doc_status={3}]'.format(self.log_base, task_str, is_priority, doc.status)) |
151 | return None, None, None, None | 151 | return None, None, None, None, None |
152 | doc.status = DocStatus.PROCESSING.value | 152 | doc.status = DocStatus.PROCESSING.value |
153 | doc.start_time = timezone.now() | 153 | doc.start_time = timezone.now() |
154 | doc.save() | 154 | doc.save() |
... | @@ -158,8 +158,8 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -158,8 +158,8 @@ class Command(BaseCommand, LoggerMixin): |
158 | self.log_base, traceback.format_exc())) | 158 | self.log_base, traceback.format_exc())) |
159 | raise e | 159 | raise e |
160 | else: | 160 | else: |
161 | self.online_log.info('{0} [get_doc_info] [db save end] [task_str={1}] [is_priority={2}]'.format( | 161 | self.online_log.info('{0} [get_doc_info] [db save end] [task_str={1}] [is_priority={2}] [re_ocr_flag={3}]'.format( |
162 | self.log_base, task_str, is_priority)) | 162 | self.log_base, task_str, is_priority, re_ocr_flag)) |
163 | return doc, business_type, rebuild_task_str, classify_1_str, re_ocr_flag | 163 | return doc, business_type, rebuild_task_str, classify_1_str, re_ocr_flag |
164 | 164 | ||
165 | # def pdf_download(self, doc, pdf_path): | 165 | # def pdf_download(self, doc, pdf_path): | ... | ... |
-
Please register or sign in to post a comment