Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/producer.py
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | @click.option('--dry-run/--no-dry-run', default=False, is_flag=True, | ||||
help="Dry run flag") | help="Dry run flag") | ||||
@click.option('--start-from-scratch', default=False, is_flag=True, | @click.option('--start-from-scratch', default=False, is_flag=True, | ||||
help="Start from scratch option") | help="Start from scratch option") | ||||
def produce_svn_to_load(url, origin_url, destination_path, visit_date, | def produce_svn_to_load(url, origin_url, destination_path, visit_date, | ||||
synchroneous, dry_run, start_from_scratch): | synchroneous, dry_run, start_from_scratch): | ||||
"""Produce svn urls to celery queue | """Produce svn urls to celery queue | ||||
""" | """ | ||||
task = get_task('swh.loader.svn.tasks.LoadSWHSvnRepositoryTsk') | task = get_task('swh.loader.svn.tasks.LoadSvnRepository') | ||||
ardumont: For info, that will impact the scheduler's setup (when we'll package this) | |||||
if synchroneous: | if synchroneous: | ||||
fn = task | fn = task | ||||
else: | else: | ||||
fn = task.delay | fn = task.delay | ||||
for args in _produce_svn_to_load(svn_url=url, | for args in _produce_svn_to_load(svn_url=url, | ||||
origin_url=origin_url, | origin_url=origin_url, | ||||
Show All 22 Lines | @click.option('--dry-run/--no-dry-run', default=False, is_flag=True, | ||||
help="Dry run flag") | help="Dry run flag") | ||||
@click.option('--start-from-scratch', default=False, is_flag=True, | @click.option('--start-from-scratch', default=False, is_flag=True, | ||||
help="Start from scratch option") | help="Start from scratch option") | ||||
def produce_archive_to_mount_and_load(path, visit_date, synchroneous, dry_run, | def produce_archive_to_mount_and_load(path, visit_date, synchroneous, dry_run, | ||||
start_from_scratch): | start_from_scratch): | ||||
"""Produce svn dumps to celery queue | """Produce svn dumps to celery queue | ||||
""" | """ | ||||
task = get_task('swh.loader.svn.tasks.MountAndLoadSvnRepositoryTsk') | task = get_task('swh.loader.svn.tasks.MountAndLoadSvnRepository') | ||||
if synchroneous: | if synchroneous: | ||||
fn = task | fn = task | ||||
else: | else: | ||||
fn = task.delay | fn = task.delay | ||||
for args in _produce_archive_to_mount_and_load(path, visit_date): | for args in _produce_archive_to_mount_and_load(path, visit_date): | ||||
print(args) | print(args) | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |
For info, that will impact the scheduler's setup (when we'll package this)