mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
Commit after changing job state
This commit is contained in:
@@ -1697,9 +1697,10 @@ class Job(Base, JobLike, UsesCreateAndUpdateTime, Dictifiable, Serializable):
|
||||
.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:
|
||||
|
||||
Reference in New Issue
Block a user