Skip to content

Commit

Permalink
Remove usage of device_managers dict for anything except unknown ma…
Browse files Browse the repository at this point in the history
…nager.
  • Loading branch information
UpstreamData committed Jul 30, 2024
1 parent 752990d commit 696de97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions goosebit/updater/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 696de97

Please sign in to comment.