Adding in a method for sync update of push.

This commit is contained in:
Charlton Austin 2016-10-31 16:55:31 -04:00
parent 6ae13096c7
commit dce06132eb

View file

@ -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))