diff --git a/goosebit/updater/manager.py b/goosebit/updater/manager.py index a7752ec4..b1c39831 100644 --- a/goosebit/updater/manager.py +++ b/goosebit/updater/manager.py @@ -308,10 +308,11 @@ async def clear_log(self) -> None: async def get_update_manager(dev_id: str) -> UpdateManager: global device_managers - if device_managers.get(dev_id) is None: - device_managers[dev_id] = DeviceUpdateManager(dev_id) + if device_managers.get(dev_id) is not None: + return device_managers[dev_id] + manager = DeviceUpdateManager(dev_id) devices_count.set(await Device.all().count()) - return device_managers[dev_id] + return manager async def delete_device(dev_id: str) -> None: