j
This commit is contained in:
@@ -2831,6 +2831,8 @@ class PipelineExecutor:
|
||||
total_stages=len(stages),
|
||||
pipe_index=pipe_idx,
|
||||
worker_id=session.worker_id if session else None,
|
||||
on_emit=(lambda x: progress_ui.on_emit(pipe_idx, x))
|
||||
if progress_ui is not None and pipe_idx is not None else None,
|
||||
)
|
||||
|
||||
# Set context for the current run
|
||||
@@ -2839,6 +2841,12 @@ class PipelineExecutor:
|
||||
ctx.set_current_stage_text(" ".join(stage_tokens))
|
||||
ctx.clear_emits()
|
||||
|
||||
if progress_ui is not None and pipe_idx is not None:
|
||||
# Start the pipe task in the UI. For most cmdlets we assume 1 item
|
||||
# initially; cmdlets that process multiple items (like search)
|
||||
# should call begin_pipe themselves with the actual count.
|
||||
progress_ui.begin_pipe(pipe_idx, total_items=1)
|
||||
|
||||
# RUN THE CMDLET
|
||||
cmd_fn(piped_result, stage_args, config)
|
||||
|
||||
@@ -2848,10 +2856,9 @@ class PipelineExecutor:
|
||||
piped_result = stage_emits if len(stage_emits) > 1 else stage_emits[0]
|
||||
else:
|
||||
piped_result = None
|
||||
|
||||
if progress_ui is not None and pipe_idx is not None:
|
||||
progress_ui.complete_stage(pipe_idx)
|
||||
finally:
|
||||
if progress_ui is not None and pipe_idx is not None:
|
||||
progress_ui.finish_pipe(pipe_idx)
|
||||
if session:
|
||||
try:
|
||||
session.close()
|
||||
@@ -2870,6 +2877,10 @@ class PipelineExecutor:
|
||||
finally:
|
||||
# Stop Live progress and clear pipeline-level live progress
|
||||
if progress_ui is not None:
|
||||
try:
|
||||
progress_ui.complete_all_pipes()
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
progress_ui.stop()
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user