Skip to content

Commit

Permalink
Merge pull request #501 from ungarj/commands_task_details
Browse files Browse the repository at this point in the history
execute: make printing task details optional
  • Loading branch information
ungarj committed Nov 21, 2022
2 parents 12bbd8f + 008f8f1 commit eae5c00
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mapchete/commands/_execute.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def execute(
def _empty_callback(_):
pass

print_task_details = msg_callback is not None
msg_callback = msg_callback or _empty_callback
if multi is not None: # pragma: no cover
warnings.warn("The 'multi' parameter is deprecated and is now named 'workers'")
Expand Down Expand Up @@ -177,7 +178,7 @@ def _empty_callback(_):
tile=tile,
workers=workers,
zoom=None if tile else zoom,
concurrency=concurrency,
print_task_details=print_task_details,
dask_max_submitted_tasks=dask_max_submitted_tasks,
dask_chunksize=dask_chunksize,
dask_compute_graph=dask_compute_graph,
Expand All @@ -204,7 +205,7 @@ def _empty_callback(_):
def _process_everything(
msg_callback,
mp,
concurrency=None,
print_task_details=True,
**kwargs,
):
try:
Expand All @@ -214,10 +215,7 @@ def _process_everything(
),
1,
):
if concurrency == "dask":
# don't call future.result()
msg_callback(f"Task {i} finished")
else:
if print_task_details:
process_info = future.result()
if isinstance(
process_info, PreprocessingProcessInfo
Expand Down

0 comments on commit eae5c00

Please sign in to comment.