From 061d4c32db3cab5a880bad912deaa89c06acb641 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 3 Apr 2024 19:02:19 +0200 Subject: [PATCH] Commit after changing job state --- lib/galaxy/model/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index a8747f62bddd..795e1dbddb67 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -1697,9 +1697,10 @@ def set_state(self, state: JobState) -> bool: .where(Job.id == self.id, ~Job.state.in_((state, *Job.finished_states))) .values(state=state) ) + 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. - session.expire(self, ["state"]) self.state_history.append(JobStateHistory(self)) return True else: