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