Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/cli.py
Show First 20 Lines • Show All 627 Lines • ▼ Show 20 Lines | task_type = dict( | ||||
max_queue_length=None, | max_queue_length=None, | ||||
num_retries=None, | num_retries=None, | ||||
retry_delay=None, | retry_delay=None, | ||||
) | ) | ||||
scheduler.create_task_type(task_type) | scheduler.create_task_type(task_type) | ||||
click.echo('OK') | click.echo('OK') | ||||
@cli.command('updater') | |||||
@click.option('--verbose/--no-verbose', '-v', default=False, | |||||
help='Verbose mode') | |||||
@click.pass_context | |||||
def updater(ctx, verbose): | |||||
"""Insert tasks in the scheduler from the scheduler-updater's events | |||||
""" | |||||
from swh.scheduler.updater.writer import UpdaterWriter | |||||
UpdaterWriter(**ctx.obj['config']).run() | |||||
@cli.command('ghtorrent') | |||||
@click.option('--verbose/--no-verbose', '-v', default=False, | |||||
help='Verbose mode') | |||||
@click.pass_context | |||||
def ghtorrent(ctx, verbose): | |||||
"""Consume events from ghtorrent and write them to cache. | |||||
""" | |||||
from swh.scheduler.updater.ghtorrent import GHTorrentConsumer | |||||
from swh.scheduler.updater.backend import SchedulerUpdaterBackend | |||||
ght_config = ctx.obj['config'].get('ghtorrent', {}) | |||||
back_config = ctx.obj['config'].get('scheduler_updater', {}) | |||||
backend = SchedulerUpdaterBackend(**back_config) | |||||
ardumont: beware the packaging debian here, iirc, the packages are separated (without dependency i think). | |||||
GHTorrentConsumer(backend, **ght_config).run() | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
cli() | cli() |
beware the packaging debian here, iirc, the packages are separated (without dependency i think)...