7653f384 by 冯轩

ADD:log

1 parent 6027ea34
...@@ -1675,16 +1675,20 @@ class Command(BaseCommand, LoggerMixin): ...@@ -1675,16 +1675,20 @@ class Command(BaseCommand, LoggerMixin):
1675 path_split = img_path.split('/') 1675 path_split = img_path.split('/')
1676 task_str = consts.SPLIT_STR.join((path_split[-5], path_split[-3])) 1676 task_str = consts.SPLIT_STR.join((path_split[-5], path_split[-3]))
1677 1677
1678 self.online_log.info('{0} [before lock] [img={1}] '.format(self.log_base, img_path))
1678 with lock: 1679 with lock:
1680 self.online_log.info('{0} [get lock] [img={1}] '.format(self.log_base, img_path))
1679 doc_res_dict = res_dict.setdefault(task_str, {}) 1681 doc_res_dict = res_dict.setdefault(task_str, {})
1680 doc_res_dict[img_path] = ocr_1_res 1682 doc_res_dict[img_path] = ocr_1_res
1681 res_dict[task_str] = doc_res_dict 1683 res_dict[task_str] = doc_res_dict
1682 todo_count = todo_count_dict.get(task_str) 1684 todo_count = todo_count_dict.get(task_str)
1683 if todo_count == 1: 1685 if todo_count == 1:
1684 finish_queue.put(task_str) 1686 finish_queue.put(task_str)
1687 self.online_log.info('{0} [ocr_1 to finish_queue] [img={1}] '.format(self.log_base, img_path))
1685 del todo_count_dict[task_str] 1688 del todo_count_dict[task_str]
1686 else: 1689 else:
1687 todo_count_dict[task_str] = todo_count - 1 1690 todo_count_dict[task_str] = todo_count - 1
1691 self.online_log.info('{0} [after lock] [img={1}] '.format(self.log_base, img_path))
1688 except Exception as e: 1692 except Exception as e:
1689 self.online_log.error('{0} [process error (store ocr res)] [img_path={1}] [error={2}]'.format( 1693 self.online_log.error('{0} [process error (store ocr res)] [img_path={1}] [error={2}]'.format(
1690 self.log_base, img_path, traceback.format_exc())) 1694 self.log_base, img_path, 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!