mirror of
https://github.com/chrisbenincasa/tunarr.git
synced 2026-04-18 09:03:35 -04:00
fix: only create one instance of ChildProcessHelper per-FfmpegInfo
This commit is contained in:
@@ -71,6 +71,8 @@ export class FfmpegInfo {
|
|||||||
return format(`${path}_${CacheKeys[command]}`, ...args);
|
return format(`${path}_${CacheKeys[command]}`, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private childProcessHelper = new ChildProcessHelper();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@inject(KEYS.FFmpegPath) private ffmpegPath: string,
|
@inject(KEYS.FFmpegPath) private ffmpegPath: string,
|
||||||
@inject(KEYS.FFprobePath) private ffprobePath: string,
|
@inject(KEYS.FFprobePath) private ffprobePath: string,
|
||||||
@@ -353,7 +355,7 @@ export class FfmpegInfo {
|
|||||||
args: string[],
|
args: string[],
|
||||||
opts?: GetStdoutOptions,
|
opts?: GetStdoutOptions,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
return new ChildProcessHelper().getStdout(executable, args, opts);
|
return this.childProcessHelper.getStdout(executable, args, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
private cacheKey(key: keyof typeof CacheKeys): string {
|
private cacheKey(key: keyof typeof CacheKeys): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user