Commit ce3954e5 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed CLI based re-processing.

parent 5c4bead7
Pipeline #98263 passed with stages
in 26 minutes and 9 seconds
......@@ -85,7 +85,8 @@ def __run_parallel(
def __run_processing(
uploads, parallel: int, process, label: str, reprocess_running: bool = False):
uploads, parallel: int, process, label: str, reprocess_running: bool = False,
wait_for_tasks: bool = True):
def run_process(upload, logger):
logger.info(
......@@ -101,6 +102,9 @@ def __run_processing(
else:
upload.reset(force=True)
process(upload)
if wait_for_tasks:
upload.block_until_complete(interval=.5)
else:
upload.block_until_process_complete(interval=.5)
if upload.tasks_status == proc.FAILURE:
......@@ -198,7 +202,9 @@ def lift_embargo(dry, parallel):
search.index_all(entries)
if not dry:
__run_processing(uploads_to_repack, parallel, lambda upload: upload.re_pack(), 're-packing')
__run_processing(
uploads_to_repack, parallel, lambda upload: upload.re_pack(), 're-packing',
wait_for_tasks=False)
@admin.command()
......
......@@ -340,7 +340,9 @@ def re_process(ctx, uploads, parallel: int, reprocess_running: bool):
@click.pass_context
def re_pack(ctx, uploads, parallel: int):
_, uploads = query_uploads(ctx, uploads)
__run_processing(uploads, parallel, lambda upload: upload.re_pack(), 're-packing')
__run_processing(
uploads, parallel, lambda upload: upload.re_pack(), 're-packing',
wait_for_tasks=False)
@uploads.command(help='Attempt to abort the processing of uploads.')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment