Skip to content

Commit

Permalink
fix ruff errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Feb 8, 2025
1 parent d568896 commit 34312ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nicegui/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ async def _create_tab_storage(self, tab_id: str) -> None:
if tab_id not in self._tabs:
if Storage.redis_url:
self._tabs[tab_id] = Storage._create_persistent_dict(f'tab-{tab_id}')
assert isinstance(self._tabs[tab_id], PersistentDict)
await self._tabs[tab_id].initialize()
else:
self._tabs[tab_id] = ObservableDict()
Expand All @@ -184,7 +185,8 @@ async def prune_tab_storage(self) -> None:
for tab_id, tab in list(self._tabs.items()):
if time.time() > tab.last_modified + self.max_tab_storage_age:
tab.clear()
await tab.close()
if isinstance(tab, PersistentDict):
await tab.close()
del self._tabs[tab_id]
await asyncio.sleep(PURGE_INTERVAL)

Expand Down

0 comments on commit 34312ee

Please sign in to comment.