Catalog collection reads gzipped search responses; admin lyrics jobs resume once their table exists
This commit is contained in:
@@ -360,7 +360,11 @@ export function registerAdminToolsRoutes(app, { db, adminAuth, media = null, bac
|
||||
} finally { activeJobId = null; workerBusy = false; }
|
||||
}
|
||||
if (autoStartJobs) {
|
||||
sql.execute("UPDATE admin_lyrics_jobs SET status='queued',updated_at=unixepoch() WHERE status='running'").then(() => runBulkJob()).catch(error => console.warn('[admin-tools] could not resume lyrics jobs:', error.message));
|
||||
// The table is created by the schema setup, which may still be running at
|
||||
// start-up: retry until it exists rather than skipping the resume.
|
||||
const resume = (tries = 0) => sql.execute("UPDATE admin_lyrics_jobs SET status='queued',updated_at=unixepoch() WHERE status='running'").then(() => runBulkJob())
|
||||
.catch(error => { if (/no such table/.test(error.message) && tries < 30) setTimeout(() => resume(tries + 1), 2000).unref?.(); else console.warn('[admin-tools] could not resume lyrics jobs:', error.message); });
|
||||
resume();
|
||||
const timer = setInterval(runBulkJob, 1000); timer.unref?.();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user