diff --git a/backend/copr_backend/background_worker_build.py b/backend/copr_backend/background_worker_build.py index d0344a1f2..e5a8e0940 100644 --- a/backend/copr_backend/background_worker_build.py +++ b/backend/copr_backend/background_worker_build.py @@ -249,6 +249,11 @@ def _fill_build_info_file(self): info_file_path, error, )) + def _update_frontend_task(self, data): + self.log.info("Sending build state back to frontend: %s", + json.dumps(data)) + self.frontend_client.update(data) + def _mark_running(self, attempt): """ Announce everywhere that a build process started now. @@ -263,9 +268,8 @@ def _mark_running(self, attempt): self.log.info("Not re-notifying FE and msg buses for the new host.") return - self.log.info("Marking build as running on frontend") data = {"builds": [self.job.to_dict()]} - self.frontend_client.update(data) + self._update_frontend_task(data) for topic in ['build.start', 'chroot.start']: self.sender.announce(topic, self.job, self.last_hostname) @@ -284,7 +288,7 @@ def _mark_finished(self): self.log.info("Worker %s build, took %s", text_status, self.job.took_seconds) data = {"builds": [self.job.to_dict()]} - self.frontend_client.update(data) + self._update_frontend_task(data) self.sender.announce("build.end", self.job, self.last_hostname) def _parse_results(self):