shutdown gracefully when sigint is recieved

This commit is contained in:
Emily 2021-03-02 09:18:00 +11:00
parent 2f5f066588
commit 208f2c2d01
1 changed files with 5 additions and 0 deletions

View File

@ -145,4 +145,9 @@ process.on('uncaughtException', (error) => {
process.on('unhandledRejection', err => {
client.logger.error('UNHANDLED_PROMISE_ERROR', err.stack);
});
// Shut down gracefully when SIGINT is recieved
process.on('SIGINT', () => {
client.functions.shutdown();
});