From 2953c3f16f3f9a4088cde1e582d3d97e1f189c1b Mon Sep 17 00:00:00 2001 From: Arksine Date: Wed, 30 Dec 2020 11:54:23 -0500 Subject: [PATCH] update_manager: Use the "klippy_identified" event to update Klippy paths Only update the Klipper Repo Object if the paths have changed. Signed-off-by: Eric Callahan --- moonraker/plugins/update_manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/moonraker/plugins/update_manager.py b/moonraker/plugins/update_manager.py index 7460265..4e6d045 100644 --- a/moonraker/plugins/update_manager.py +++ b/moonraker/plugins/update_manager.py @@ -92,7 +92,7 @@ class UpdateManager: # Register Ready Event self.server.register_event_handler( - "server:klippy_ready", self._set_klipper_repo) + "server:klippy_identified", self._set_klipper_repo) # Initialize GitHub API Rate Limits IOLoop.current().spawn_callback(self._init_api_rate_limit) @@ -103,6 +103,11 @@ class UpdateManager: return kpath = kinfo['klipper_path'] env = kinfo['python_path'] + kupdater = self.updaters.get('klipper', None) + if kupdater is not None and kupdater.repo_path == kpath and \ + kupdater.env == env: + # Current Klipper Updater is valid + return self.updaters['klipper'] = GitUpdater(self, "klipper", kpath, env) async def _handle_update_request(self, web_request):