68d7dd98 by 周伟奇

add catch error

1 parent c1ca6fa5
......@@ -379,6 +379,7 @@ class Command(BaseCommand, LoggerMixin):
else:
wb = Workbook()
for result in result_list:
try:
sheet_name, head_fields = self.sheet_content[result[self.CLASSIFY_KEY]]
row = []
for field in head_fields:
......@@ -389,6 +390,9 @@ class Command(BaseCommand, LoggerMixin):
ws = wb.create_sheet(sheet_name)
ws.append(head_fields)
ws.append(row)
except Exception as e:
self.folder_log.info('{0} [daily wb failed] [result={1}] [error={2}]'.format(
self.log_base, result, traceback.format_exc()))
wb.save(wb_path)
def folder_process(self, input_dir, classify, result_queue):
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!