Change returns to trollius returns
This commit is contained in:
parent
0e5f6dc17d
commit
a6fa08c19c
1 changed files with 6 additions and 3 deletions
|
@ -294,7 +294,7 @@ class BuildComponent(BaseComponent):
|
||||||
version)
|
version)
|
||||||
raise trollius.Return(False)
|
raise trollius.Return(False)
|
||||||
|
|
||||||
if self._component_status != 'waiting':
|
if self._component_status != 'waiting5':
|
||||||
logger.warning('Build component (token "%s") is already connected', self.expected_token)
|
logger.warning('Build component (token "%s") is already connected', self.expected_token)
|
||||||
raise trollius.Return(False)
|
raise trollius.Return(False)
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ class BuildComponent(BaseComponent):
|
||||||
# If the component is no longer running or actively building, nothing more to do.
|
# If the component is no longer running or actively building, nothing more to do.
|
||||||
if (self._component_status != ComponentStatus.RUNNING and
|
if (self._component_status != ComponentStatus.RUNNING and
|
||||||
self._component_status != ComponentStatus.BUILDING):
|
self._component_status != ComponentStatus.BUILDING):
|
||||||
return
|
raise trollius.Return()
|
||||||
|
|
||||||
# If there is an active build, write the heartbeat to its status.
|
# If there is an active build, write the heartbeat to its status.
|
||||||
build_status = self._build_status
|
build_status = self._build_status
|
||||||
|
@ -352,12 +352,15 @@ class BuildComponent(BaseComponent):
|
||||||
if (self._last_heartbeat and
|
if (self._last_heartbeat and
|
||||||
self._last_heartbeat < datetime.datetime.utcnow() - HEARTBEAT_DELTA):
|
self._last_heartbeat < datetime.datetime.utcnow() - HEARTBEAT_DELTA):
|
||||||
yield trollius.From(self._timeout())
|
yield trollius.From(self._timeout())
|
||||||
return
|
raise trollius.Return()
|
||||||
|
|
||||||
yield trollius.From(trollius.sleep(HEARTBEAT_TIMEOUT))
|
yield trollius.From(trollius.sleep(HEARTBEAT_TIMEOUT))
|
||||||
|
|
||||||
@trollius.coroutine
|
@trollius.coroutine
|
||||||
def _timeout(self):
|
def _timeout(self):
|
||||||
|
if self._component_status == ComponentStatus.TIMED_OUT:
|
||||||
|
raise trollius.Return()
|
||||||
|
|
||||||
yield trollius.From(self._set_status(ComponentStatus.TIMED_OUT))
|
yield trollius.From(self._set_status(ComponentStatus.TIMED_OUT))
|
||||||
logger.warning('Build component with realm %s has timed out', self.builder_realm)
|
logger.warning('Build component with realm %s has timed out', self.builder_realm)
|
||||||
|
|
||||||
|
|
Reference in a new issue