fix: Geisterzaehler nach Neustart + rkllm-Leck in /api/search/answer
Aufgefallen beim Nachsehen, warum die GUI bei 29:32 Audio 2h34min Analysezeit zeigte. 1. Ein systemctl restart SIGKILLt alle Kindprozesse, die DB-Zeile blieb aber auf analysis_status=pending mit gesetztem analysis_started_at. Die GUI zaehlte dadurch ewig hoch fuer Arbeit, die es nicht mehr gab. db.failStaleJobs() setzt beim Start pending/transcribing auf error - zum Startzeitpunkt kann kein Job legitim laufen. 2. /api/search/answer lud rkllm und gab es nie frei: 1h48min lang 82,6% RAM belegt, nur 237 MB verfuegbar. Genau der Zustand, den analyzeRecording und rediarize mit llm.stopServer() bewusst vermeiden, weil der TitaNet-Helfer daneben an OOM stirbt (auf #71 seinerzeit 48 Rohsprecher). stopServer() jetzt im finally der Route.
This commit is contained in:
@@ -191,6 +191,21 @@ export async function setTranscript(id, transcript, words) {
|
||||
await replaceWords(id, words || []);
|
||||
}
|
||||
|
||||
// Every in-flight job dies with the service: systemd SIGKILLs the whisper,
|
||||
// spk_embed and rkllm children on stop, and nothing resumes them. The row
|
||||
// however still reads 'pending' with a start stamp, so the GUI shows
|
||||
// "KI-Analyse läuft…" and a timer counting up forever on work that no longer
|
||||
// exists (observed: 2 h 34 min on a 29-minute recording after a deploy
|
||||
// restart). Called once at boot — at that moment no job CAN legitimately be
|
||||
// running — so the retry button appears instead of a phantom counter.
|
||||
export async function failStaleJobs() {
|
||||
const [a] = await pool.query(
|
||||
"UPDATE recordings SET analysis_status='error' WHERE analysis_status='pending' AND analysis_started_at IS NOT NULL");
|
||||
const [t] = await pool.query(
|
||||
"UPDATE recordings SET status='error' WHERE status='transcribing'");
|
||||
return { analyses: a.affectedRows, transcriptions: t.affectedRows };
|
||||
}
|
||||
|
||||
// Stamp the wall-clock start of a processing run (transcribe+diar+LLM). The
|
||||
// GUI shows a live counter from here; updateAnalysis('done') freezes the total
|
||||
// into analysis_ms. Called at every trigger (record-stop, retranscribe, reanalyze).
|
||||
|
||||
Reference in New Issue
Block a user