Skip to content

Instantly share code, notes, and snippets.

@perbu
Created September 9, 2019 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perbu/a8484056541f40270ffbab4a27c67d41 to your computer and use it in GitHub Desktop.
Save perbu/a8484056541f40270ffbab4a27c67d41 to your computer and use it in GitHub Desktop.
function signalHandle(signal) {
console.log('Received signal ', signal);
server.em.emit("serverShutdown", "Shutdown initiated by signal "+signal);
}
process.on('SIGINT', signalHandle);
process.on('SIGTERM', signalHandle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment