Skip to content

Commit

Permalink
Commit after changing job state
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Apr 3, 2024
1 parent 16e0e4b commit 061d4c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 061d4c3

Please sign in to comment.