From 4c84f66e15a361d9f3d650def1ba97fa80506456 Mon Sep 17 00:00:00 2001 From: jarbasal Date: Sun, 25 Oct 2020 23:09:47 +0000 Subject: [PATCH] skill settings sync flag --- mycroft/configuration/mycroft.conf | 3 ++- mycroft/skills/settings.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mycroft/configuration/mycroft.conf b/mycroft/configuration/mycroft.conf index dc7666468c..b18eb9b09a 100644 --- a/mycroft/configuration/mycroft.conf +++ b/mycroft/configuration/mycroft.conf @@ -126,7 +126,8 @@ "url": "https://api.mycroft.ai", "version": "v1", "update": true, - "metrics": false + "metrics": false, + "sync_skill_settings": true }, // The mycroft-core messagebus websocket diff --git a/mycroft/skills/settings.py b/mycroft/skills/settings.py index 6effde5ff0..a211de2f58 100644 --- a/mycroft/skills/settings.py +++ b/mycroft/skills/settings.py @@ -137,6 +137,12 @@ class SettingsMetaUploader: self.settings_meta = {} self.api = None self.upload_timer = None + self.sync_enabled = self.config["server"].get("sync_skill_settings", + False) + if not self.sync_enabled: + LOG.info("Skill settings sync is disabled, settingsmeta will " + "not be uploaded") + self._stopped = None # Property placeholders @@ -216,6 +222,8 @@ class SettingsMetaUploader: The settingsmeta file does not change often, if at all. Only perform the upload if a change in the file is detected. """ + if not self.sync_enabled: + return synced = False if is_paired(): self.api = DeviceApi() @@ -315,6 +323,11 @@ class SkillSettingsDownloader: self.remote_settings = None self.api = DeviceApi() self.download_timer = None + self.sync_enabled = Configuration.get()["server"]\ + .get("sync_skill_settings", False) + if not self.sync_enabled: + LOG.info("Skill settings sync is disabled, backend settings will " + "not be downloaded") def stop_downloading(self): """Stop synchronizing backend and core.""" @@ -328,6 +341,8 @@ class SkillSettingsDownloader: When used as a messagebus handler a message is passed but not used. """ + if not self.sync_enabled: + return if is_paired(): remote_settings = self._get_remote_settings() if remote_settings: