c011a3cd by 周伟奇

fix bug

1 parent 36ca3f9a
...@@ -93,7 +93,7 @@ class Command(BaseCommand, LoggerMixin): ...@@ -93,7 +93,7 @@ class Command(BaseCommand, LoggerMixin):
93 task_str, is_priority = rh.dequeue() 93 task_str, is_priority = rh.dequeue()
94 if task_str is None: 94 if task_str is None:
95 self.online_log.info('{0} [get_doc_info] [queue empty]'.format(self.log_base)) 95 self.online_log.info('{0} [get_doc_info] [queue empty]'.format(self.log_base))
96 return None, None, None, None, None 96 return None, None, None, None
97 97
98 self.online_log.info('{0} [get_doc_info] [task={1}] [is_priority={2}]'.format( 98 self.online_log.info('{0} [get_doc_info] [task={1}] [is_priority={2}]'.format(
99 self.log_base, task_str, is_priority)) 99 self.log_base, task_str, is_priority))
...@@ -114,11 +114,11 @@ class Command(BaseCommand, LoggerMixin): ...@@ -114,11 +114,11 @@ class Command(BaseCommand, LoggerMixin):
114 if doc is None: 114 if doc is None:
115 self.online_log.warn('{0} [get_doc_info] [doc not exist] [task_str={1}] [is_priority={2}]'.format( 115 self.online_log.warn('{0} [get_doc_info] [doc not exist] [task_str={1}] [is_priority={2}]'.format(
116 self.log_base, task_str, is_priority)) 116 self.log_base, task_str, is_priority))
117 return None, None, None, None, None 117 return None, None, None, None
118 elif doc.status != DocStatus.INIT.value: 118 elif doc.status != DocStatus.INIT.value:
119 self.online_log.warn('{0} [get_doc_info] [doc status error] [task_str={1}] [is_priority={2}] ' 119 self.online_log.warn('{0} [get_doc_info] [doc status error] [task_str={1}] [is_priority={2}] '
120 '[doc_status={3}]'.format(self.log_base, task_str, is_priority, doc.status)) 120 '[doc_status={3}]'.format(self.log_base, task_str, is_priority, doc.status))
121 return None, None, None, None, None 121 return None, None, None, None
122 doc.status = DocStatus.PROCESSING.value 122 doc.status = DocStatus.PROCESSING.value
123 doc.start_time = timezone.now() 123 doc.start_time = timezone.now()
124 doc.save() 124 doc.save()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!