Fix keyerror in cache autocleanup (#1674)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 18 Sep 2024 21:37:15 +0000 (23:37 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Sep 2024 21:37:15 +0000 (23:37 +0200)
music_assistant/server/controllers/cache.py

index 0d7e6b85adb6b99ff605176edba92a2d57862c1d..7196879170fa08bd373a32b089e7242a0d754ecf 100644 (file)
@@ -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: