Skip to content

Commit

Permalink
job manager: cleaner _job_update_loop
Browse files Browse the repository at this point in the history
related to #614
  • Loading branch information
soxofaan committed Sep 27, 2024
1 parent ffa7be2 commit 215ebce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openeo/extra/job_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def run_loop():
sum(job_db.count_by_status(statuses=["not_started", "created", "queued", "running"]).values()) > 0
and not self._stop_thread
):
self._job_update_loop(df, job_db, start_job)
self._job_update_loop(job_db=job_db, start_job=start_job)

# Do sequence of micro-sleeps to allow for quick thread exit
for _ in range(int(max(1, self.poll_sleep))):
Expand Down Expand Up @@ -454,10 +454,10 @@ def run_jobs(
job_db.persist(df)

while sum(job_db.count_by_status(statuses=["not_started", "created", "queued", "running"]).values()) > 0:
self._job_update_loop(df, job_db, start_job)
self._job_update_loop(job_db=job_db, start_job=start_job)
time.sleep(self.poll_sleep)

def _job_update_loop(self, df, job_db, start_job):
def _job_update_loop(self, job_db: JobDatabaseInterface, start_job: Callable[[], BatchJob]):
"""
Inner loop logic of job management:
go through the necessary jobs to check for status updates,
Expand Down

0 comments on commit 215ebce

Please sign in to comment.