fix: move exit message to child_process on successful http listen

This commit is contained in:
Alexis
2021-09-10 06:21:24 +09:30
parent e7f04a77b5
commit e9779e74f1

View File

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