Skip to content

Commit

Permalink
Added note about .on vs .once
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Dec 23, 2014
1 parent 3b74560 commit f40dcc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/app/private/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ module.exports = function initialize(cb) {
process.kill(process.pid, 'SIGUSR2');
});
});

// Roadmap: can we get away w/ making this `.once()`?
process.on('SIGINT', function() {
sails.lower(process.exit);
});
// Roadmap: can we get away w/ making this `.once()`?
process.on('SIGTERM', function() {
sails.lower(process.exit);
});
// Roadmap: can we get away w/ making this `.once()`?
process.on('exit', function() {
if (!sails._exiting) sails.lower();
});
Expand Down

0 comments on commit f40dcc8

Please sign in to comment.