From 6cde33f6e691c2e07e9374d704cf645e21d83e6a Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 13 Nov 2023 15:48:10 +0100 Subject: [PATCH] Apply Nicola's suggestions --- lib/galaxy/model/__init__.py | 4 ++-- lib/galaxy/workflow/scheduling_manager.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 5c413a4af799..c2e201eb3f52 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -1635,9 +1635,9 @@ def all_entry_points_configured(self): all_configured = ep.configured and all_configured return all_configured - def set_state(self, state): + def set_state(self, state: JobState) -> bool: """ - Save state history. Returns True if stat has changed, else False + Save state history. Returns True if state has changed, else False. """ if self.state == state: # Nothing changed, no action needed diff --git a/lib/galaxy/workflow/scheduling_manager.py b/lib/galaxy/workflow/scheduling_manager.py index b8851def3e7a..31f4bca49ae1 100644 --- a/lib/galaxy/workflow/scheduling_manager.py +++ b/lib/galaxy/workflow/scheduling_manager.py @@ -333,7 +333,7 @@ def __attempt_schedule(self, invocation_id, workflow_scheduler): try: if workflow_invocation.state == workflow_invocation.states.CANCELLING: workflow_invocation.cancel_invocation_steps() - workflow_invocation.state = workflow_invocation.states.CANCELLED + workflow_invocation.mark_cancelled() session.commit() return False