Skip to content
Snippets Groups Projects
Commit b7cb9024 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

jqueue: Always print message for 100% when inspecting queue

Reviewed-by: iustinp
parent b28a3e8b
No related branches found
No related tags found
No related merge requests found
...@@ -542,13 +542,14 @@ class JobQueue(object): ...@@ -542,13 +542,14 @@ class JobQueue(object):
logging.info("Inspecting job queue") logging.info("Inspecting job queue")
all_job_ids = self._GetJobIDsUnlocked() all_job_ids = self._GetJobIDsUnlocked()
jobs_count = len(all_job_ids)
lastinfo = time.time() lastinfo = time.time()
for idx, job_id in enumerate(all_job_ids): for idx, job_id in enumerate(all_job_ids):
# Give an update every 1000 jobs or 10 seconds # Give an update every 1000 jobs or 10 seconds
if idx % 1000 == 0 or time.time() >= (lastinfo + 10.0): if (idx % 1000 == 0 or time.time() >= (lastinfo + 10.0) or
jobs_count = len(all_job_ids) idx == (jobs_count - 1)):
logging.info("Job queue inspection: %d/%d (%0.1f %%)", logging.info("Job queue inspection: %d/%d (%0.1f %%)",
idx, jobs_count, 100.0 * (idx + 1) / jobs_count) idx, jobs_count - 1, 100.0 * (idx + 1) / jobs_count)
lastinfo = time.time() lastinfo = time.time()
job = self._LoadJobUnlocked(job_id) job = self._LoadJobUnlocked(job_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment