Merge pull request #2157 from jzelinskie/fixasync
wrap build_complete coroutine in callback
This commit is contained in:
commit
f119f0790e
1 changed files with 5 additions and 1 deletions
|
@ -157,7 +157,11 @@ class BuildComponent(BaseComponent):
|
||||||
logger.debug('Invoking build: %s', self.builder_realm)
|
logger.debug('Invoking build: %s', self.builder_realm)
|
||||||
logger.debug('With Arguments: %s', build_arguments)
|
logger.debug('With Arguments: %s', build_arguments)
|
||||||
|
|
||||||
self.call("io.quay.builder.build", **build_arguments).add_done_callback(self._build_complete)
|
def build_complete_callback(result):
|
||||||
|
""" This function is used to execute a coroutine as the callback. """
|
||||||
|
trollius.ensure_future(self._build_complete(result))
|
||||||
|
|
||||||
|
self.call("io.quay.builder.build", **build_arguments).add_done_callback(build_complete_callback)
|
||||||
|
|
||||||
# Set the heartbeat for the future. If the builder never receives the build call,
|
# Set the heartbeat for the future. If the builder never receives the build call,
|
||||||
# then this will cause a timeout after 30 seconds. We know the builder has registered
|
# then this will cause a timeout after 30 seconds. We know the builder has registered
|
||||||
|
|
Reference in a new issue