Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
Co-authored-by: John Davis <[email protected]>
  • Loading branch information
mvdbeek and jdavcs authored Apr 3, 2024
1 parent 061d4c3 commit 2594276
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand All @@ -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:
Expand Down

0 comments on commit 2594276

Please sign in to comment.