Add catcher for PM2 graceful shutdown

This commit is contained in:
Dave Conway-Jones 2020-02-04 13:42:34 +00:00
parent fcf757f715
commit 0622be843b
No known key found for this signature in database
GPG Key ID: 302A6725C594817F
1 changed files with 3 additions and 0 deletions

View File

@ -353,3 +353,6 @@ process.on('SIGTERM', brexit);
process.on('SIGHUP', brexit);
process.on('SIGUSR2', brexit); // for nodemon restart
process.on('SIGBREAK', brexit); // for windows ctrl-break
process.on('message', function(m) { // for PM2 under window with --shutdown-with-message
if (m === 'shutdown') { brexit }
});