Beispiel #1
0
    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 = AsyncIOBackend(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)