Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/cli.py
Show First 20 Lines • Show All 369 Lines • ▼ Show 20 Lines | def respawn_tasks(ctx, task_ids, next_run): | ||||
if not scheduler: | if not scheduler: | ||||
raise ValueError('Scheduler class (local/remote) must be instantiated') | raise ValueError('Scheduler class (local/remote) must be instantiated') | ||||
if next_run is None: | if next_run is None: | ||||
next_run = arrow.utcnow() | next_run = arrow.utcnow() | ||||
output = [] | output = [] | ||||
scheduler.set_status_tasks( | scheduler.set_status_tasks( | ||||
task_ids, status='next_run_not_scheduled', next_run=next_run) | task_ids, status='next_run_not_scheduled', next_run=next_run) | ||||
output.append('Respawn tasks %s\n' % ( | output.append('Respawn tasks %s\n' % (task_ids,)) | ||||
task_ids)) | |||||
click.echo('\n'.join(output)) | click.echo('\n'.join(output)) | ||||
@task.command('archive') | @task.command('archive') | ||||
@click.option('--before', '-b', default=None, | @click.option('--before', '-b', default=None, | ||||
help='''Task whose ended date is anterior will be archived. | help='''Task whose ended date is anterior will be archived. | ||||
Default to current month's first day.''') | Default to current month's first day.''') | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |