From dce06132eb46c6670a78a44064f333a762dc76b7 Mon Sep 17 00:00:00 2001 From: Charlton Austin Date: Mon, 31 Oct 2016 16:55:31 -0400 Subject: [PATCH] Adding in a method for sync update of push. --- buildman/component/buildcomponent.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/buildman/component/buildcomponent.py b/buildman/component/buildcomponent.py index 8996c35ac..5295cac61 100644 --- a/buildman/component/buildcomponent.py +++ b/buildman/component/buildcomponent.py @@ -69,6 +69,7 @@ class BuildComponent(BaseComponent): yield From(self.subscribe(self._on_heartbeat, 'io.quay.builder.heartbeat')) yield From(self.subscribe(self._on_log_message, 'io.quay.builder.logmessage')) + yield From(self.register(self._on_log_message_synchronously, 'io.quay.builder.io.quay.builder.logmessagesynchronously')) yield From(self._set_status(ComponentStatus.WAITING)) @@ -248,7 +249,7 @@ class BuildComponent(BaseComponent): except InvalidRepositoryBuildException: build_id = self._current_job.repo_build.uuid logger.info('Build %s was not found; repo was probably deleted', build_id) - return + return False BuildComponent._process_pushpull_status(status_dict, phase, log_data, self._image_info) @@ -265,6 +266,7 @@ class BuildComponent(BaseComponent): self._build_status.set_command(current_status_string) elif phase == BUILD_PHASE.BUILDING: self._build_status.append_log(current_status_string) + return True @trollius.coroutine def _determine_cache_tag(self, command_comments, base_image_name, base_image_tag, base_image_id): @@ -469,3 +471,9 @@ class BuildComponent(BaseComponent): # Unregister the current component so that it cannot be invoked again. self.parent_manager.build_component_disposed(self, True) + + def _on_log_message_synchronously(self, phase, json_data): + """ A method to synchronously update the pushing + phase so we don't have cancelled builds trying to be pushed + """ + raise Return(self._on_log_message(phase, json_data))