Skip to content

Commit

Permalink
Merge branch 'praiskup-update-task-info' into praiskup-ALLMERGED
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Aug 15, 2023
2 parents 45d0021 + e68239c commit 61965ad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backend/copr_backend/background_worker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand All @@ -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):
Expand Down

0 comments on commit 61965ad

Please sign in to comment.