From 2594276b13472b9ea9c2332103bbfab3281f1265 Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Wed, 3 Apr 2024 19:39:50 +0200 Subject: [PATCH] Update comments Co-authored-by: John Davis --- lib/galaxy/model/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 795e1dbddb67..8097776a56b5 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -1691,7 +1691,7 @@ def set_state(self, state: JobState) -> bool: return False session = object_session(self) if session and self.id and state not in Job.finished_states: - # generate statement that will not revert DELETING or DELETED back to anything non-terminal + # Do not update if job is in a terminal state rval = session.execute( update(Job.table) .where(Job.id == self.id, ~Job.state.in_((state, *Job.finished_states))) @@ -1700,7 +1700,6 @@ def set_state(self, state: JobState) -> bool: with transaction(session): session.commit() if rval.rowcount == 1: - # Need to expire state since we just updated it, but ORM doesn't know about it. self.state_history.append(JobStateHistory(self)) return True else: