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
......@@ -542,13 +542,14 @@ class JobQueue(object):
logging.info("Inspecting job queue")
all_job_ids = self._GetJobIDsUnlocked()
jobs_count = len(all_job_ids)
lastinfo = time.time()
for idx, job_id in enumerate(all_job_ids):
# Give an update every 1000 jobs or 10 seconds
if idx % 1000 == 0 or time.time() >= (lastinfo + 10.0):
jobs_count = len(all_job_ids)
if (idx % 1000 == 0 or time.time() >= (lastinfo + 10.0) or
idx == (jobs_count - 1)):
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()
job = self._LoadJobUnlocked(job_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment