From b8d4a58207597652858d1bfb4c95b27b619752f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 20 Nov 2018 12:27:42 +0100 Subject: [PATCH] SWU: remove one thread level on_after_startup now runs in its own thread, no need to spawn yet another. --- src/octoprint/plugins/softwareupdate/__init__.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index 23d9fa9f2..863c67b0b 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -99,15 +99,8 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, self._console_logger.propagate = False def on_after_startup(self): - # refresh cache now if necessary so it's faster once the user connects to the instance - but decouple it from - # the server startup - def fetch_data(): - self.get_current_versions() - self._check_environment() - - thread = threading.Thread(target=fetch_data) - thread.daemon = True - thread.start() + self._check_environment() + self.get_current_versions() def _get_configured_checks(self): with self._configured_checks_mutex: