fix: keep archive indexing off API startup
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
<div class="stats-bar" id="statsBar">
|
||||
<div class="stat"><span class="label">Total articles</span><span class="value" id="s-total">—</span></div>
|
||||
<div class="stat"><span class="label">With content</span><span class="value" id="s-content">—</span></div>
|
||||
<div class="stat"><span class="label">Intelligence ready</span><span class="value" id="s-content">—</span></div>
|
||||
<div class="stat"><span class="label">With embedding</span><span class="value" id="s-embed">—</span></div>
|
||||
<div class="stat"><span class="label">Events</span><span class="value" id="s-events">—</span></div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<div class="stats-bar" id="statsBar">
|
||||
<div class="stat"><span class="label">Total articles</span><span class="value" id="s-total">—</span></div>
|
||||
<div class="stat"><span class="label">With content</span><span class="value" id="s-content">—</span></div>
|
||||
<div class="stat"><span class="label">Intelligence ready</span><span class="value" id="s-content">—</span></div>
|
||||
<div class="stat"><span class="label">With embedding</span><span class="value" id="s-embed">—</span></div>
|
||||
<div class="stat"><span class="label">Events</span><span class="value" id="s-events">—</span></div>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<div class="stats-bar" id="statsBar">
|
||||
<div class="stat"><span class="label">Total articles</span><span class="value" id="s-total">—</span></div>
|
||||
<div class="stat"><span class="label">With content</span><span class="value" id="s-content">—</span></div>
|
||||
<div class="stat"><span class="label">Intelligence ready</span><span class="value" id="s-content">—</span></div>
|
||||
<div class="stat"><span class="label">With embedding</span><span class="value" id="s-embed">—</span></div>
|
||||
<div class="stat"><span class="label">Events</span><span class="value" id="s-events">—</span></div>
|
||||
</div>
|
||||
|
||||
@@ -47,12 +47,7 @@ db.exec(`
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_normalized_title ON articles(normalized_title);
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_event_id ON articles(event_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_has_embedding ON articles(has_embedding);
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_content_status ON articles(content_status);
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_content_attempted_at ON articles(content_attempted_at);
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_pub_date_effective ON articles(pub_date_effective DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_has_content
|
||||
ON articles(id)
|
||||
WHERE content IS NOT NULL AND content != '';
|
||||
CREATE INDEX IF NOT EXISTS idx_articles_usable_pub_date
|
||||
ON articles(pub_date_effective DESC, id DESC)
|
||||
WHERE content IS NOT NULL
|
||||
@@ -79,11 +74,6 @@ db.exec(`
|
||||
);
|
||||
`);
|
||||
|
||||
db.exec(`
|
||||
CREATE INDEX IF NOT EXISTS idx_article_embedding_meta_embedded_at
|
||||
ON article_embedding_meta(embedded_at);
|
||||
`);
|
||||
|
||||
db.exec(`
|
||||
CREATE VIRTUAL TABLE IF NOT EXISTS article_embeddings USING vec0(
|
||||
article_id INTEGER PRIMARY KEY,
|
||||
|
||||
+8
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user