Skip to main content

manager: clean up the SQLite sidecar files (-shm, -wal)

ID
be4497c
date
2026-11-06 23:10:38+00:00
author
Alex Chan <alexc@tailscale.com>
parent
3e11553
message
manager: clean up the SQLite sidecar files (-shm, -wal)

When clearing a stale instance of the cache, we should clean up the
sidecar files at the same time, not just the database.

This would require two processes to be running and accessing the same
cache directory directly, which is unlikely for my use case, but we can
be a bit cleaner here anyway.
changed files
1 file, 1 addition, 1 deletion

Changed files

src/funkycache/manager.py (11691 → 11692)

diff --git a/src/funkycache/manager.py b/src/funkycache/manager.py
index aedbe63..6ba8e77 100644
--- a/src/funkycache/manager.py
+++ b/src/funkycache/manager.py
@@ -214,7 +214,7 @@ class FunkyCache:
                 self._root.mkdir(exist_ok=True, parents=True)
                 db_path = self._root / f"{identifier}.{input_sig}.db"
                 storage = SQLiteCacheStorage[R](db_path, data_type=data_type)
-                for f in self._root.glob(f"{identifier}.*.db"):
+                for f in self._root.glob(f"{identifier}.*.db*"):
                     if f != db_path:
                         f.unlink()
                 return storage