#1174 backend: lower traffic in build_dispatcher log
Merged 4 years ago by praiskup. Opened 4 years ago by praiskup.
Unknown source only-new-build-ids  into  master

@@ -41,7 +41,7 @@

          self.arch_to_groups = defaultdict(list)

          # PC => max N builders per user

          self.group_to_usermax = dict()

- 

+         self.job_ids_previous_request = set()

          self.init_internal_structures()

  

      def get_vm_group_ids(self, arch):
@@ -89,7 +89,12 @@

                  if not tasks:

                      time.sleep(self.opts.sleeptime)

  

-         self.log.info("Got new build jobs: %s", [task.get("task_id") for task in tasks if task])

+         job_ids = {task.get("task_id") for task in tasks if task}

+         new_ids = job_ids - self.job_ids_previous_request

+         if new_ids:

+             self.log.info("Got new build jobs: %s", new_ids)

+         self.job_ids_previous_request = job_ids

+ 

          return [BuildJob(task, self.opts) for task in tasks if task]

  

      def can_build_start(self, job):

For each pending-job request we logged all the task IDs in queue, which
may be tens of thousands characters. So remember the last set of task
IDs, and print really only the new IDs since the last request.

rebased onto 75ea8fb73ebad8744e007b6bd37001bc76335f1b

4 years ago

rebased onto 20a3b50

4 years ago

Pull-Request has been merged by praiskup

4 years ago