From 81b609f55e2614485169e43c4cdd037ab2666d52 Mon Sep 17 00:00:00 2001 From: pax Date: Sun, 5 Apr 2026 19:50:04 -0500 Subject: [PATCH] Trigger cache eviction after infinite scroll page drain Prevents unbounded cache growth during long infinite scroll sessions. Runs after each batch of posts finishes loading. --- booru_viewer/gui/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/booru_viewer/gui/app.py b/booru_viewer/gui/app.py index 2182bd9..9bbed75 100644 --- a/booru_viewer/gui/app.py +++ b/booru_viewer/gui/app.py @@ -909,8 +909,9 @@ class BooruApp(QMainWindow): if self._append_queue: QTimer.singleShot(50, self._drain_append_queue) else: - # All done — unlock loading and prefetch + # All done — unlock loading, evict, prefetch self._loading = False + self._auto_evict_cache() if self._db.get_setting_bool("prefetch_adjacent"): self._prefetch_adjacent(idx) # Check if still at bottom or content doesn't fill viewport