mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
Logging adjustment
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user