mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 12:13:33 +08:00
Fix user total walltime calculation when jobs are missing states in job
state history.
This commit is contained in:
@@ -611,7 +611,11 @@ class JobHandlerQueue(Monitors):
|
||||
elif history.state == "ok":
|
||||
finished = history.create_time
|
||||
|
||||
time_spent += finished - started
|
||||
if started is not None and finished is not None:
|
||||
time_spent += finished - started
|
||||
else:
|
||||
log.warning(
|
||||
f"Unable to calculate time spent for job {job.id}; started: {started}, finished: {finished}")
|
||||
|
||||
if time_spent > self.app.job_config.limits.total_walltime["delta"]:
|
||||
return JOB_USER_OVER_TOTAL_WALLTIME, job_destination
|
||||
|
||||
Reference in New Issue
Block a user