Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorg shutdown to prevent logged exceptions in skill shutdown #240

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions mycroft/skills/mycroft_skill/mycroft_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -1597,18 +1597,26 @@ def default_shutdown(self):
if self._settings_watchdog:
self._settings_watchdog.shutdown()

# Clear skill from gui
self.gui.shutdown()

# removing events
self.event_scheduler.shutdown()
self.events.clear()

# Let the skill stop before shutting down the GUI and event_scheduler
try:
self.stop()
except Exception:
LOG.error(f'Failed to stop skill: {self.skill_id}', exc_info=True)

# Clear skill from gui
try:
self.gui.shutdown()
except Exception as e:
LOG.exception(f"Gui shutdown failed: {e}")

# removing events
try:
self.event_scheduler.shutdown()
self.events.clear()
except Exception as e:
LOG.exception(f"event_scheduler shutdown failed: {e}")

# Let the skill specify any extra shutdown steps
try:
self.shutdown()
except Exception as e:
Expand Down