refactor: remove unused getThreads function and related code from voice API and controller

This commit is contained in:
MythEclipse
2026-05-16 23:34:07 +07:00
parent 7dedac2094
commit 99ec528a03
7 changed files with 115 additions and 92 deletions

View File

@@ -35,10 +35,16 @@ async function processAnalysisRequest({
messages,
}: AnalysisWorkerRequest): Promise<AnalysisWorkerResponse> {
try {
if (!dbInitialized) {
await initializeDatabase();
dbInitialized = true;
try {
if (!dbInitialized) {
await initializeDatabase();
dbInitialized = true;
}
} catch (dbError) {
const msg = dbError instanceof Error ? dbError.message : String(dbError);
return { ok: false, conversationKey, rows: [], error: `Database init failed: ${msg}` };
}
const firstMessage = messages[0];
if (!firstMessage) return { ok: true, conversationKey, rows: [] };