Fix user total walltime calculation when jobs are missing states in job

state history.
This commit is contained in:
Nate Coraor
2021-04-21 10:50:17 -04:00
parent 69b65ac99a
commit 55f4d5fdc1
+5 -1
View File
@@ -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