From 9332b2e19660973f54dcd2636c4409736e0a69cd Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Tue, 14 May 2024 09:20:58 +0000 Subject: [PATCH] config/env: validate platform for processingPriority on startup instead of for every stream thread --- src/modules/config.js | 4 +++- src/modules/stream/types.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/config.js b/src/modules/config.js index b774a8b6..93347ad4 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -32,7 +32,9 @@ const corsWildcard: process.env.CORS_WILDCARD !== '0', corsURL: process.env.CORS_URL, 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), apiURL } diff --git a/src/modules/stream/types.js b/src/modules/stream/types.js index 7054a3b2..87c9f600 100644 --- a/src/modules/stream/types.js +++ b/src/modules/stream/types.js @@ -44,7 +44,7 @@ function pipe(from, to, done) { } function getCommand(args) { - if (!isNaN(env.processingPriority) && process.platform !== "win32") { + if (!isNaN(env.processingPriority)) { return ['nice', ['-n', env.processingPriority.toString(), ffmpeg, ...args]] } return [ffmpeg, args]