fix(media): don't cache whisper binary detection failure
Only cache successful whisper binary lookups. When whisper is not found, leave the cache empty so subsequent calls re-check PATH. This allows the app to detect a newly installed whisper without requiring a restart. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c27f4e66b5
commit
1bd25c5aec
1 changed files with 3 additions and 3 deletions
|
|
@ -18,8 +18,8 @@ import { execFile, execFileSync } from "node:child_process";
|
|||
import { tmpdir } from "node:os";
|
||||
import { credentialManager } from "../agent/credentials.js";
|
||||
|
||||
/** Cached path to local whisper binary, or false if not found */
|
||||
let cachedWhisperBin: string | false | undefined;
|
||||
/** Cached path to local whisper binary (only caches success; misses re-check each time) */
|
||||
let cachedWhisperBin: string | undefined;
|
||||
|
||||
/** Find local whisper binary in PATH */
|
||||
function findWhisperBin(): string | false {
|
||||
|
|
@ -35,7 +35,7 @@ function findWhisperBin(): string | false {
|
|||
}
|
||||
}
|
||||
|
||||
cachedWhisperBin = false;
|
||||
// Don't cache failure — whisper may be installed while the process is running
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue