Skip to content

Commit

Permalink
fix:no wait for ready
Browse files Browse the repository at this point in the history
dont wait for mycroft.ready message, display homescreen ASAP
  • Loading branch information
JarbasAl committed Oct 21, 2024
1 parent ed1dabf commit d8c6eb1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
15 changes: 12 additions & 3 deletions ovos_gui/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,22 @@ def _define_message_handlers(self):
self.core_bus.on("mycroft.gui.connected", self.handle_client_connected)
self.core_bus.on("gui.page_interaction", self.handle_page_interaction)
self.core_bus.on("gui.page_gained_focus", self.handle_page_gained_focus)
self.core_bus.on("mycroft.skills.trained", self.handle_ready)
self.core_bus.on("mycroft.gui.screen.close", self.handle_namespace_global_back)
self.core_bus.on("gui.volunteer_page_upload", self.handle_gui_pages_available)

# TODO - deprecate this, only needed for gui bus upload
# Bus is connected, check if the skills service is ready
resp = self.core_bus.wait_for_response(
Message("mycroft.skills.is_ready",
context={"source": "gui", "destination": ["skills"]}))
if resp and resp.data.get("status"):
LOG.debug("Skills service already running")
self._ready_event.set()
else:
self.core_bus.on("mycroft.skills.trained", self.handle_ready)

def handle_ready(self, message):
self._ready_event.set()
self.core_bus.on("gui.volunteer_page_upload",
self.handle_gui_pages_available)

def handle_gui_pages_available(self, message: Message):
"""
Expand Down
10 changes: 0 additions & 10 deletions ovos_gui/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ def run(self):

self.extension_manager = ExtensionsManager("EXTENSION_SERVICE", self.bus)
self.namespace_manager = NamespaceManager(self.bus)

# Bus is connected, check if the skills service is ready
resp = self.bus.wait_for_response(
Message("mycroft.skills.is_ready",
context={"source": "gui", "destination": ["skills"]}))
if resp and resp.data.get("status"):
LOG.debug("Skills service already running")
self.namespace_manager.handle_ready(resp)
self.extension_manager.homescreen_manager.set_mycroft_ready(resp)

self.status.set_ready()
LOG.info(f"GUI Service Ready")

Expand Down

0 comments on commit d8c6eb1

Please sign in to comment.