b39c34cf by 周伟奇

add log

1 parent 1bd26cf0
......@@ -910,13 +910,16 @@ class Command(BaseCommand, LoggerMixin):
old_res_str = getattr(res_obj, field)
if old_res_str is None:
last_res_str = json.dumps(license_list)
else
else:
old_res_list = json.loads(old_res_str)
old_res_list.extend(license_list)
last_res_str = json.dumps(old_res_list)
setattr(res_obj, field, last_res_str)
res_obj.save()
self.online_log.info('{0} [ocr result save success] [task={1}] [res_id={2}]'.format(
self.log_base, task_str, res_obj.id))
# 触发比对
# compare.apply_async((doc.application_id, business_type, None, ocr_res_id), queue='queue_compare')
finally:
......@@ -926,6 +929,7 @@ class Command(BaseCommand, LoggerMixin):
shutil.rmtree(img_save_path, ignore_errors=True)
pdf_path = os.path.join(doc_data_path, '{0}.pdf'.format(doc_id_str))
os.remove(pdf_path)
self.online_log.info('{0} [pdf & img remove] [task={1}]'.format(self.log_base, task_str))
except Exception as e:
self.online_log.error('{0} [process error (pdf & img remove)] [task={1}] [error={2}]'.format(
self.log_base, task_str, traceback.format_exc()))
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!