update_manager: apply the command lock to initialization
This makes sure that the Klipper and Moonraker git repos are not initialized simultaneously. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
47902cb03c
commit
48621da6aa
|
@ -114,6 +114,7 @@ class UpdateManager:
|
||||||
self._initalize_updaters, list(self.updaters.values()))
|
self._initalize_updaters, list(self.updaters.values()))
|
||||||
|
|
||||||
async def _initalize_updaters(self, initial_updaters):
|
async def _initalize_updaters(self, initial_updaters):
|
||||||
|
async with self.cmd_request_lock:
|
||||||
self.is_refreshing = True
|
self.is_refreshing = True
|
||||||
await self.cmd_helper.init_api_rate_limit()
|
await self.cmd_helper.init_api_rate_limit()
|
||||||
for updater in initial_updaters:
|
for updater in initial_updaters:
|
||||||
|
@ -139,6 +140,7 @@ class UpdateManager:
|
||||||
return
|
return
|
||||||
kcfg = self.config[f"update_manager static {self.distro} klipper"]
|
kcfg = self.config[f"update_manager static {self.distro} klipper"]
|
||||||
self.updaters['klipper'] = GitUpdater(kcfg, self.cmd_helper, kpath, env)
|
self.updaters['klipper'] = GitUpdater(kcfg, self.cmd_helper, kpath, env)
|
||||||
|
async with self.cmd_request_lock:
|
||||||
await self.updaters['klipper'].refresh()
|
await self.updaters['klipper'].refresh()
|
||||||
|
|
||||||
async def _check_klippy_printing(self):
|
async def _check_klippy_printing(self):
|
||||||
|
|
Loading…
Reference in New Issue