From e1febfd92cb377402b32d0c2790c96f30a37a351 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:45:23 -0800 Subject: [PATCH] Logging adjustment --- javascript/gallery.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index c4f483b5e..ed17499c0 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -683,10 +683,12 @@ async function thumbCacheCleanup(folder, imgCount, controller) { const t0 = performance.now(); const staticGalleryHashes = new Set(galleryHashes); // External context should be safe since this function run is guarded by AbortController/AbortSignal in the SimpleFunctionQueue const cachedHashesCount = await idbCount(folder) - .catch(() => Infinity); // Forces next check to fail if something went wrong + .catch((e) => { + error(`Thumbnail DB cleanup: Error when getting entry count for "${folder}".`, e); + return Infinity; // Forces next check to fail if something went wrong + }); if (cachedHashesCount < staticGalleryHashes.size + 500) { // Don't run when there aren't many excess entries - debug('Thumbnail DB cleanup: Maintenance is not needed yet'); return; }