From 5a547f69d5dc5867e253f7721513479c754b4f15 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 Nov 2020 14:08:23 +0100 Subject: Support encoding profiles --- shared/extra-utils/server/servers.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'shared/extra-utils') diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts index a647b0eb4..75e79cc41 100644 --- a/shared/extra-utils/server/servers.ts +++ b/shared/extra-utils/server/servers.ts @@ -104,7 +104,7 @@ function randomRTMP () { return randomInt(low, high) } -async function flushAndRunServer (serverNumber: number, configOverride?: Object, args = []) { +async function flushAndRunServer (serverNumber: number, configOverride?: Object, args = [], silent = true) { const parallel = parallelTests() const internalServerNumber = parallel ? randomServer() : serverNumber @@ -133,10 +133,10 @@ async function flushAndRunServer (serverNumber: number, configOverride?: Object, } } - return runServer(server, configOverride, args) + return runServer(server, configOverride, args, silent) } -async function runServer (server: ServerInfo, configOverrideArg?: any, args = []) { +async function runServer (server: ServerInfo, configOverrideArg?: any, args = [], silent?: boolean) { // These actions are async so we need to be sure that they have both been done const serverRunString = { 'Server listening': false @@ -240,7 +240,11 @@ async function runServer (server: ServerInfo, configOverrideArg?: any, args = [] // If no, there is maybe one thing not already initialized (client/user credentials generation...) if (dontContinue === true) return - server.app.stdout.removeListener('data', onStdout) + if (silent === false) { + console.log(data.toString()) + } else { + server.app.stdout.removeListener('data', onStdout) + } process.on('exit', () => { try { -- cgit v1.2.3