use a better query for evictOverflow

This commit is contained in:
Muki Kiboigo committed 2026-08-07 08:01:54 -07:00
1 parent 4f5bcec9a6
commit f80aa2882c
1 file changed
+4 -2
+4 -2
View File
@@ -140,8 +140,10 @@ fn evictOverflow(self: *SqliteCache, conn: Conn) !void {
try conn.exec(
\\ delete from cache
\\ where url not in (
\\ select url from cache order by stored_at desc limit $1
\\ where rowid in (
\\ select rowid from cache
\\ order by stored_at desc
\\ limit -1 offset $1
\\ )
, .{@as(i64, @intCast(limit))});
}