Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit f9ca087

Browse files
committed
fix: check if there are no queued jobs
1 parent cdee922 commit f9ca087

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@ def process_workflow_job():
128128
def monitor_queued_jobs():
129129
"""Return the job that has been queued and not starting for long time."""
130130
app.logger.debug("Starting monitor_queued_jobs")
131+
131132
if not jobs:
132133
return
133134

134135
queued_jobs = [job for job in jobs.values() if job.action == "queued"]
136+
if not queued_jobs:
137+
return
138+
135139
job = min(queued_jobs, key=lambda x: x.time_start)
136140
delay = (datetime.now() - job.time_start).seconds
137141

0 commit comments

Comments
 (0)