fix folder bug
Showing
1 changed file
with
4 additions
and
2 deletions
| ... | @@ -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( | ... | ... | 
- 
Please register or sign in to post a comment