config/env: validate platform for processingPriority on startup

instead of for every stream thread
This commit is contained in:
dumbmoron 2024-05-14 09:20:58 +00:00
parent 5b50d441eb
commit 9332b2e196
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -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
} }

View file

@ -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]