Commit fe758ca3 authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

app: do not restart the server if app is closing

parent 08b933cc
......@@ -95,10 +95,12 @@ function server() {
logger.error(data.toString().trim())
})
proc.on('exit', () => {
function restart() {
logger.info('Restarting the server...')
server()
})
}
proc.on('exit', restart)
proc.on('disconnect', () => {
logger.info('Server disconnected. Reconnecting...')
......@@ -106,6 +108,7 @@ function server() {
})
process.on('exit', () => {
proc.off('exit', restart)
proc.kill()
})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment