config/env: validate platform for processingPriority on startup
instead of for every stream thread
This commit is contained in:
parent
5b50d441eb
commit
9332b2e196
2 changed files with 4 additions and 2 deletions
|
@ -32,7 +32,9 @@ const
|
||||||
corsWildcard: process.env.CORS_WILDCARD !== '0',
|
corsWildcard: process.env.CORS_WILDCARD !== '0',
|
||||||
corsURL: process.env.CORS_URL,
|
corsURL: process.env.CORS_URL,
|
||||||
cookiePath: process.env.COOKIE_PATH,
|
cookiePath: process.env.COOKIE_PATH,
|
||||||
processingPriority: process.env.PROCESSING_PRIORITY && parseInt(process.env.PROCESSING_PRIORITY),
|
processingPriority: process.platform !== "win32"
|
||||||
|
&& process.env.PROCESSING_PRIORITY
|
||||||
|
&& parseInt(process.env.PROCESSING_PRIORITY),
|
||||||
tiktokDeviceInfo: process.env.TIKTOK_DEVICE_INFO && JSON.parse(process.env.TIKTOK_DEVICE_INFO),
|
tiktokDeviceInfo: process.env.TIKTOK_DEVICE_INFO && JSON.parse(process.env.TIKTOK_DEVICE_INFO),
|
||||||
apiURL
|
apiURL
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ function pipe(from, to, done) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCommand(args) {
|
function getCommand(args) {
|
||||||
if (!isNaN(env.processingPriority) && process.platform !== "win32") {
|
if (!isNaN(env.processingPriority)) {
|
||||||
return ['nice', ['-n', env.processingPriority.toString(), ffmpeg, ...args]]
|
return ['nice', ['-n', env.processingPriority.toString(), ffmpeg, ...args]]
|
||||||
}
|
}
|
||||||
return [ffmpeg, args]
|
return [ffmpeg, args]
|
||||||
|
|
Loading…
Reference in a new issue