Skip to content

Commit a29ce52

Browse files
kostrykinmvdbeek
authored andcommitted
Update activity.py
1 parent 6fae02d commit a29ce52

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

planemo/galaxy/activity.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,15 @@ def _execute( # noqa C901
241241

242242

243243
def invocation_to_run_response(
244-
ctx, user_gi, runnable, invocation, polling_backoff=0, no_wait=False, start_datetime=None, log=None, early_termination=True
244+
ctx,
245+
user_gi,
246+
runnable,
247+
invocation,
248+
polling_backoff=0,
249+
no_wait=False,
250+
start_datetime=None,
251+
log=None,
252+
early_termination=True,
245253
):
246254
start_datetime = start_datetime or datetime.now()
247255
invocation_id = invocation["id"]
@@ -766,7 +774,13 @@ def _history_id(gi, **kwds) -> str:
766774

767775

768776
def wait_for_invocation_and_jobs(
769-
ctx, invocation_id: str, history_id: str, user_gi: GalaxyInstance, no_wait: bool, polling_backoff: int, early_termination: bool
777+
ctx,
778+
invocation_id: str,
779+
history_id: str,
780+
user_gi: GalaxyInstance,
781+
no_wait: bool,
782+
polling_backoff: int,
783+
early_termination: bool,
770784
):
771785
ctx.vlog("Waiting for invocation [%s]" % invocation_id)
772786
final_invocation_state = "new"
@@ -865,17 +879,17 @@ def _wait_for_invocation_jobs(ctx, gi, invocation_id, polling_backoff=0, early_t
865879
def state_func():
866880
return _retry_on_timeouts(ctx, gi, lambda gi: gi.jobs.get_jobs(invocation_id=invocation_id))
867881

868-
return _wait_on_state(ctx, state_func, polling_backoff, early_termination=early_termination)
882+
return _wait_on_state(state_func, polling_backoff, early_termination=early_termination)
869883

870884

871885
def _wait_for_job(gi, job_id, timeout=None):
872886
def state_func():
873887
return gi.jobs.show_job(job_id, full_details=True)
874888

875-
return _wait_on_state(ctx, state_func, timeout=timeout)
889+
return _wait_on_state(state_func, timeout=timeout)
876890

877891

878-
def _wait_on_state(ctx, state_func, polling_backoff=0, timeout=None, early_termination=True):
892+
def _wait_on_state(state_func, polling_backoff=0, timeout=None, early_termination=True):
879893
def get_state():
880894
response = state_func()
881895
if not isinstance(response, list):
@@ -902,7 +916,6 @@ def get_state():
902916
for terminal_state in hierarchical_fail_states:
903917
if terminal_state in current_states:
904918
# If we got here something has failed and we can return (early)
905-
ctx.log(f"Early termination.")
906919
return terminal_state
907920
if current_non_terminal_states:
908921
return None

0 commit comments

Comments
 (0)