ADD:log
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -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())) | ... | ... |
-
Please register or sign in to post a comment