Skip to content

Commit

Permalink
Only update job if state really changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Apr 3, 2024
1 parent 8ab16a9 commit 16e0e4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,7 @@ def set_state(self, state: JobState) -> bool:
# generate statement that will not revert DELETING or DELETED back to anything non-terminal
rval = session.execute(
update(Job.table)
.where(Job.id == self.id, ~Job.state.in_((Job.states.DELETING, Job.states.DELETED)))
.where(Job.id == self.id, ~Job.state.in_((state, *Job.finished_states)))
.values(state=state)
)
if rval.rowcount == 1:
Expand Down

0 comments on commit 16e0e4b

Please sign in to comment.