From ac74c5a9d31c1720123d4a9dfd6c4ba5bd92dbc5 Mon Sep 17 00:00:00 2001 From: Maria Lainez <98marialainez@gmail.com> Date: Tue, 5 Nov 2024 11:57:54 +0100 Subject: [PATCH] get last job_id if there are more than one job_id --- src/osa/scripts/sequencer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osa/scripts/sequencer.py b/src/osa/scripts/sequencer.py index 0a375a8d..e90ee1e4 100644 --- a/src/osa/scripts/sequencer.py +++ b/src/osa/scripts/sequencer.py @@ -364,8 +364,9 @@ def timeout_in_sequencer(date: datetime.datetime) -> bool: for run in data_runs["run_id"]: jobs_run = sacct_info[sacct_info["JobName"]==f"LST1_{run:05d}"] - last_job_id = sorted(jobs_run["JobID"].unique())[-1] - jobs_run = sacct_info[sacct_info["JobID"]==last_job_id] + if len(jobs_run["JobID"].unique())>1: + last_job_id = sorted(jobs_run["JobID"].unique())[-1] + jobs_run = sacct_info[sacct_info["JobID"]==last_job_id] timeout_jobs = jobs_run[(jobs_run["State"] == "TIMEOUT")] if len(timeout_jobs) != 0: return True