Skip to content

Commit

Permalink
refactor/skill_loader_from_workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Apr 20, 2023
1 parent cb1af76 commit 6b9e380
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mycroft/skills/skill_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Periodically run by skill manager to load skills into memory."""
import os
from time import time
from ovos_utils.log import LOG

# backwards compat imports do not delete
from ovos_plugin_manager.skills import find_skill_plugins
Expand Down Expand Up @@ -79,6 +80,21 @@ def __init__(self, bus, skill_directory=None):
self.last_modified = 0
self.modtime_error_log_written = False

def _handle_filechange(self):
super()._handle_filechange()
# NOTE: below could be removed, but is kept for api backwards compatibility
# users of SkillLoader will still have all properties properly updated
# TODO on ntp sync last_modified needs to be updated
try:
self.last_modified = _get_last_modified_time(self.skill_directory)
except OSError as err:
self.last_modified = self.last_loaded
if not self.modtime_error_log_written:
self.modtime_error_log_written = True
LOG.error(f'Failed to get last_modification time ({err})')
else:
self.modtime_error_log_written = False

def reload_needed(self):
"""DEPRECATED: backwards compatibility only
Expand Down

0 comments on commit 6b9e380

Please sign in to comment.