Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add to index.js
- exitOnSignal('SIGINT');
- exitOnSignal('SIGTERM');
- function exitOnSignal(signal) {
- process.on(signal, function() {
- console.log('\ncaught ' + signal + ', exiting');
- // perform all required cleanup
- process.exit(1);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement