Skip to content

Commit

Permalink
return False if no jobs were launched yet
Browse files Browse the repository at this point in the history
  • Loading branch information
marialainez committed Aug 16, 2024
1 parent af6fefb commit 45f97a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/osa/scripts/sequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,14 @@ def is_sequencer_running(date) -> bool:
def sequencer_finished(date) -> bool:
"""Check if the jobs launched by sequencer are running or pending for the given date."""
summary_table = run_summary_table(date)
data_runs = summary_table[summary_table["run_type"] == "DATA"]
sacct_output = run_sacct()
sacct_info = get_sacct_output(sacct_output)

for run in summary_table["run_id"]:
for run in data_runs["run_id"]:
jobs_run = sacct_info[sacct_info["JobName"]==f"LST1_{run}"]
incomplete_jobs = jobs_run[(jobs_run["State"] != "COMPLETED")]
if len(incomplete_jobs) != 0:
if len(jobs_run) == 0 or len(incomplete_jobs) != 0:
return False

return True
Expand Down

0 comments on commit 45f97a8

Please sign in to comment.