Revision 711b5124

b/lib/jqueue.py
511 511
      # we're still doing our work.
512 512
      self.acquire()
513 513
      try:
514
        for job in self._GetJobsUnlocked(None):
514
        logging.info("Inspecting job queue")
515

  
516
        all_job_ids = self._GetJobIDsUnlocked()
517
        lastinfo = time.time()
518
        for idx, job_id in enumerate(all_job_ids):
519
          # Give an update every 1000 jobs or 10 seconds
520
          if idx % 1000 == 0 or time.time() >= (lastinfo + 10.0):
521
            jobs_count = len(all_job_ids)
522
            logging.info("Job queue inspection: %d/%d (%0.1f %%)",
523
                         idx, jobs_count, 100.0 * (idx + 1) / jobs_count)
524
            lastinfo = time.time()
525

  
526
          job = self._LoadJobUnlocked(job_id)
527

  
515 528
          # a failure in loading the job can cause 'None' to be returned
516 529
          if job is None:
517 530
            continue
......
530 543
                op.result = "Unclean master daemon shutdown"
531 544
            finally:
532 545
              self.UpdateJobUnlocked(job)
546

  
547
        logging.info("Job queue inspection finished")
533 548
      finally:
534 549
        self.release()
535 550
    except:

Also available in: Unified diff