Commit 55f4d5fd authored by Nate Coraor's avatar Nate Coraor
Browse files

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

state history.
parent 69b65ac9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -611,7 +611,11 @@ class JobHandlerQueue(Monitors):
                    elif history.state == "ok":
                        finished = history.create_time

                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