def handle(self, *args, **options): if not options.get("restart_failed") and not options.get("files"): raise CommandError("One of the options --restart_failed or --file must be provided") backend = CeleryBackend(settings.FROM, settings.TO) if options["restart_failed"]: backend.restart_failed() print("Failed task has been restarted") else: files = list(map(str.strip, open(options["files"], "r+").readlines())) backend.move_files(files)
def handle(self, *args, **options): if not options.get('restart_failed') and not options.get('files'): raise CommandError( 'One of the options --restart_failed or --file must be provided' ) backend = CeleryBackend(settings.FROM, settings.TO) if options['restart_failed']: backend.restart_failed() print('Failed task has been restarted') else: files = list( map(str.strip, open(options['files'], 'r+').readlines())) backend.move_files(files)