From 1e7fc307385371bcf08d6efc5a167e340392d0ee Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Wed, 18 Sep 2024 23:37:15 +0200 Subject: [PATCH] Fix keyerror in cache autocleanup (#1674) --- music_assistant/server/controllers/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.34.1