mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
Update error handling and logging
This commit is contained in:
@@ -577,8 +577,8 @@ async function thumbCacheCleanup() {
|
||||
const t1 = performance.now();
|
||||
log(`Thumbnail DB cleanup: kept=${thumbHashes.size} deleted=${delcount} time=${Math.floor(t1 - t0)}ms`);
|
||||
})
|
||||
.catch(() => {
|
||||
log("Thumbnail DB cleanup: Cleanup failed");
|
||||
.catch((err) => {
|
||||
error("Thumbnail DB cleanup: Cleanup failed.", err.message);
|
||||
})
|
||||
.finally(() => {
|
||||
idbIsCleaning = false;
|
||||
|
||||
@@ -102,7 +102,7 @@ async function idbCount() {
|
||||
async function idbClean(keepSet) {
|
||||
if (!db) return null;
|
||||
if (!keepSet instanceof Set) {
|
||||
console.error("IndexedDB cleaning function must be given a Set() of hashes to keep");
|
||||
throw new TypeError("IndexedDB cleaning function must be given a Set() of hashes to keep");
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
let counter = 0;
|
||||
|
||||
Reference in New Issue
Block a user