From e9779e74f13cd1f0e59b9cdc94c0298d0795db06 Mon Sep 17 00:00:00 2001 From: Alexis Date: Fri, 10 Sep 2021 06:21:24 +0930 Subject: [PATCH] fix: move exit message to child_process on successful http listen --- app/server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/server.ts b/app/server.ts index bfd44c1e9..4cad53ecc 100644 --- a/app/server.ts +++ b/app/server.ts @@ -214,6 +214,10 @@ if (isNaN(parseInt(port, 10))) { stoppableServer.on('listening', () => { // Set permissions fs.chmodSync(port, 660); + + process.once('exit', () => { + console.info('👋 Farewell. UNRAID API shutting down!'); + }); }); stoppableServer.on('error', async (error: NodeJS.ErrnoException) => { @@ -287,10 +291,6 @@ if (isNaN(parseInt(port, 10))) { globalErrorHandler(error); } }); - - process.once('exit', () => { - console.info('👋 Farewell. UNRAID API shutting down!'); - }); } // Main ws server