d931d082 by 周伟奇

fix folder bug

1 parent 76581bb1
...@@ -335,13 +335,15 @@ class Command(BaseCommand, LoggerMixin): ...@@ -335,13 +335,15 @@ class Command(BaseCommand, LoggerMixin):
335 self.folder_log.info('{0} [file end] [path={1}]'.format(self.log_base, path)) 335 self.folder_log.info('{0} [file end] [path={1}]'.format(self.log_base, path))
336 else: 336 else:
337 self.folder_log.info('{0} [path is dir] [path={1}]'.format(self.log_base, input_dir)) 337 self.folder_log.info('{0} [path is dir] [path={1}]'.format(self.log_base, input_dir))
338 shutil.move(path, failed_output_dir) 338 failed_path = os.path.join(failed_output_dir, '{0}_{1}'.format(time.time(), name))
339 shutil.move(path, failed_path)
339 except Exception as e: 340 except Exception as e:
340 try: 341 try:
341 path = os.path.join(input_dir, name) 342 path = os.path.join(input_dir, name)
342 self.folder_log.error('{0} [file error] [path={1}] [error={2}]'.format(self.log_base, path, 343 self.folder_log.error('{0} [file error] [path={1}] [error={2}]'.format(self.log_base, path,
343 traceback.format_exc())) 344 traceback.format_exc()))
344 shutil.move(path, failed_output_dir) 345 failed_path = os.path.join(failed_output_dir, '{0}_{1}'.format(time.time(), name))
346 shutil.move(path, failed_path)
345 continue 347 continue
346 except Exception as e: 348 except Exception as e:
347 self.folder_log.error('{0} [file error] [error={1}]'.format( 349 self.folder_log.error('{0} [file error] [error={1}]'.format(
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!