Skip to content

Commit 75dbbc1

Browse files
committed
move logic from created and queued state to be blocking for launching jobs
1 parent bace886 commit 75dbbc1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openeo/extra/job_management/_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,12 @@ def _job_update_loop(
539539
stats["track_statuses"] += 1
540540

541541
not_started = job_db.get_by_status(statuses=["not_started"], max=200).copy()
542-
if len(not_started) > 0:
542+
pending = job_db.get_by_status(statuses=["created", "queued", "queued_for_start"], max=200).copy()
543+
544+
if len(not_started) > 0 and len(pending) < 10:
543545
# Check number of jobs running at each backend
544546
# TODO: should "created" be included in here? Calling this "running" is quite misleading then.
545-
running = job_db.get_by_status(statuses=["created", "queued", "queued_for_start", "running"])
547+
running = job_db.get_by_status(statuses=["running"])
546548
stats["job_db get_by_status"] += 1
547549
per_backend = running.groupby("backend_name").size().to_dict()
548550
_log.info(f"Running per backend: {per_backend}")

0 commit comments

Comments
 (0)