is the way that I was handling socket IO, express, and net (IPC).
https://gist.github.com/itshaadi/ea27e40b739bacc82958b1f96c1cb43d
none of the promise in index work. they all get resolved but nothing gets closed.
so what I did to solve this was to move the content of socket.js into server.js. (why is it working now?)
but the promises in index still won't work. instead.
process.on('SIGINT', () => {
ipc.close()
io.close()
server.close()
logger.info('graceful shutdown on SIGINT')
})
works perfectly.
do not forget to process.exit
Weird...
Maybe order matters? Maybe something fucks up if you close server before closing socket.io ?
Обсуждают сегодня