Logging adjustment

This commit is contained in:
awsr
2025-12-01 16:45:23 -08:00
parent 9ae7c1a7c7
commit e1febfd92c
+4 -2
View File
@@ -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;
}