From 8d7e5c8d43e2f5b7c7cdbfe4f3b6d7ed6db935b9 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 12 Mar 2025 21:18:59 +0000 Subject: [PATCH] fix the maths for stats --- src/services/llm/embeddings/stats.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/llm/embeddings/stats.ts b/src/services/llm/embeddings/stats.ts index fcb70cc19..ecc2ef6a8 100644 --- a/src/services/llm/embeddings/stats.ts +++ b/src/services/llm/embeddings/stats.ts @@ -32,11 +32,11 @@ export async function getEmbeddingStats() { ) as number; const queuedNotesCount = await sql.getValue( - "SELECT COUNT(*) FROM embedding_queue" + "SELECT COUNT(*) FROM embedding_queue WHERE failed = 0" ) as number; const failedNotesCount = await sql.getValue( - "SELECT COUNT(*) FROM embedding_queue WHERE attempts > 0" + "SELECT COUNT(*) FROM embedding_queue WHERE failed = 1" ) as number; // Get the last processing time by checking the most recent embedding @@ -60,7 +60,7 @@ export async function getEmbeddingStats() { // Calculate the percentage of notes that are properly embedded const percentComplete = totalNotesCount > 0 - ? Math.round((upToDateEmbeddings / totalNotesCount) * 100) + ? Math.round((upToDateEmbeddings / (totalNotesCount - failedNotesCount)) * 100) : 0; return {