fix: keep archive indexing off API startup

This commit is contained in:
ImBenji
2026-08-04 21:39:20 +01:00
parent bd162606b6
commit 2020a0fde2
5 changed files with 11 additions and 17 deletions
+8 -4
View File
@@ -843,10 +843,12 @@ async function adminRoutes(fastify) {
}
const counts = db.prepare(`
SELECT
(SELECT COUNT(*) FROM articles) AS total,
(SELECT COUNT(*) FROM articles WHERE content IS NOT NULL AND content != '') AS withContent,
COALESCE((SELECT seq FROM sqlite_sequence WHERE name='articles'), 0) AS total,
(SELECT COUNT(*) FROM articles
WHERE content IS NOT NULL AND content != ''
AND is_index_page = 0 AND has_embedding = 1) AS withContent,
(SELECT COUNT(*) FROM articles WHERE has_embedding = 1) AS withEmbedding,
(SELECT COUNT(*) FROM events) AS eventCount
COALESCE((SELECT seq FROM sqlite_sequence WHERE name='events'), 0) AS eventCount
`).get();
statsSummaryCache = { at: Date.now(), value: counts };
return counts;
@@ -863,7 +865,9 @@ async function adminRoutes(fastify) {
const counts = db.prepare(`
SELECT
(SELECT COUNT(*) FROM articles) as total,
(SELECT COUNT(*) FROM articles WHERE content IS NOT NULL AND content != '') as withContent,
(SELECT COUNT(*) FROM articles
WHERE content IS NOT NULL AND content != ''
AND is_index_page = 0 AND has_embedding = 1) as withContent,
(SELECT COUNT(*) FROM articles WHERE has_embedding = 1) as withEmbedding,
(SELECT COUNT(*) FROM events) as eventCount,
(SELECT COUNT(*) FROM articles WHERE ingested_at >= datetime('now', '-1 hour')) as ingestedPerHour,