From 208f2c2d01a10bb443a6ca7e4bf8269cbeb6b23d Mon Sep 17 00:00:00 2001 From: Emily J Date: Tue, 2 Mar 2021 09:18:00 +1100 Subject: [PATCH] shutdown gracefully when sigint is recieved --- bot/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bot/index.js b/bot/index.js index 7bccbc3..8c0dbde 100644 --- a/bot/index.js +++ b/bot/index.js @@ -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(); }); \ No newline at end of file