Merge pull request #1586 from MycroftAI/feature/configurable-update-interval

Make skill update interval configurable
pull/1590/head
Åke 2018-05-14 22:39:26 +02:00 committed by GitHub
commit ad487cc9fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -105,8 +105,8 @@
"blacklisted_skills": ["skill-media", "send_sms", "skill-wolfram-alpha"],
// priority skills to be loaded first
"priority_skills": ["mycroft-pairing", "mycroft-volume"],
// Minimum time since last skill updata to force an update on startup
"startup_update_required_time": 12
// Time between updating skills in hours
"update_interval": 1.0
},
// Address of the REMOTE server

View File

@ -203,9 +203,12 @@ class SkillManager(Thread):
self.enclosure = EnclosureAPI(ws)
# Schedule install/update of default skill
self.update_interval = Configuration.get()['skills']['update_interval']
self.update_interval = int(self.update_interval * 60 * MINUTES)
self.dot_msm = join(SKILLS_DIR, '.msm')
if exists(self.dot_msm):
self.next_download = os.path.getmtime(self.dot_msm) + 60 * MINUTES
self.next_download = os.path.getmtime(self.dot_msm) + \
self.update_interval
else:
self.next_download = time.time() - 1
@ -294,7 +297,7 @@ class SkillManager(Thread):
with open(self.dot_msm, 'a'):
os.utime(self.dot_msm, None)
self.next_download = time.time() + 60 * MINUTES
self.next_download = time.time() + self.update_interval
if speak:
data = {'utterance': dialog.get("skills updated")}