Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/cli.py
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | @click.option('--batch-size', '-b', 'origin_batch_size', | ||||
default=10, show_default=True, type=int, | default=10, show_default=True, type=int, | ||||
help="Number of origins per task") | help="Number of origins per task") | ||||
@click.option('--tool-id', '-t', 'tool_ids', type=int, multiple=True, | @click.option('--tool-id', '-t', 'tool_ids', type=int, multiple=True, | ||||
help="Restrict search of old metadata to this/these tool ids.") | help="Restrict search of old metadata to this/these tool ids.") | ||||
@click.option('--mapping', '-m', 'mappings', multiple=True, | @click.option('--mapping', '-m', 'mappings', multiple=True, | ||||
help="Mapping(s) that should be re-scheduled (eg. 'npm', " | help="Mapping(s) that should be re-scheduled (eg. 'npm', " | ||||
"'gemspec', 'maven')") | "'gemspec', 'maven')") | ||||
@click.option('--task-type', | @click.option('--task-type', | ||||
default='indexer_origin_metadata', show_default=True, | default='index-origin-metadata', show_default=True, | ||||
help="Name of the task type to schedule.") | help="Name of the task type to schedule.") | ||||
@click.pass_context | @click.pass_context | ||||
def schedule_origin_metadata_reindex( | def schedule_origin_metadata_reindex( | ||||
ctx, origin_batch_size, tool_ids, mappings, task_type): | ctx, origin_batch_size, tool_ids, mappings, task_type): | ||||
"""Schedules indexing tasks for origins that were already indexed.""" | """Schedules indexing tasks for origins that were already indexed.""" | ||||
idx_storage = ctx.obj['indexer_storage'] | idx_storage = ctx.obj['indexer_storage'] | ||||
scheduler = ctx.obj['scheduler'] | scheduler = ctx.obj['scheduler'] | ||||
Show All 31 Lines |