From: Marcel van der Veldt Date: Wed, 18 Sep 2024 21:37:15 +0000 (+0200) Subject: Fix keyerror in cache autocleanup (#1674) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=1e7fc307385371bcf08d6efc5a167e340392d0ee;p=music-assistant-server.git Fix keyerror in cache autocleanup (#1674) --- diff --git a/music_assistant/server/controllers/cache.py b/music_assistant/server/controllers/cache.py index 0d7e6b85..71968791 100644 --- a/music_assistant/server/controllers/cache.py +++ b/music_assistant/server/controllers/cache.py @@ -203,7 +203,7 @@ class CacheController(CoreController): for db_row in await self.database.get_rows(DB_TABLE_CACHE): # clean up db cache object only if expired if db_row["expires"] < cur_timestamp: - await self.delete(db_row["id"]) + await self.database.delete(DB_TABLE_CACHE, {"id": db_row["id"]}) cleaned_records += 1 await asyncio.sleep(0) # yield to eventloop if cleaned_records > 50: