Skip to content

Commit

Permalink
fix/ready_check_timeout (#88)
Browse files Browse the repository at this point in the history
Co-authored-by: jarbasai <jarbasai@mailfence.com>
  • Loading branch information
NeonJarbas and JarbasAl authored Mar 16, 2022
1 parent f388177 commit 24e0a78
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions mycroft/skills/skill_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,24 @@ def is_device_ready(self):
if is_ready:
break
elif monotonic() - start >= 60:
raise Exception(
raise TimeoutError(
f'Timeout waiting for services start. services={services}')
else:
sleep(3)
return is_ready

def handle_check_device_readiness(self, message):
if self.is_device_ready():
LOG.info("Mycroft is all loaded and ready to roll!")
self.bus.emit(message.reply('mycroft.ready'))
ready = False
while not ready:
try:
ready = self.is_device_ready()
except TimeoutError:
if is_paired():
LOG.warning("mycroft should already have reported ready!")
sleep(5)

LOG.info("Mycroft is all loaded and ready to roll!")
self.bus.emit(message.reply('mycroft.ready'))

def check_services_ready(self, services):
"""Report if all specified services are ready.
Expand Down

0 comments on commit 24e0a78

Please sign in to comment.