From 430e0f9e513e22384cf612c4c5ad346ba4dd4755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 2 Sep 2021 19:18:20 +0300 Subject: [PATCH] Added SIGTERM event --- src/Client.ts | 4 ++++ src/client/events/SIGTERM.js | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 src/client/events/SIGTERM.js diff --git a/src/Client.ts b/src/Client.ts index 95a3235..e5ef66b 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -75,6 +75,10 @@ class RadioClient extends Client { process.on('SIGINT', () => { require(`${events}SIGINT`).execute(this); }); + + process.on('SIGTERM', () => { + require(`${events}SIGTERM`).execute(this); + }); this.on("error", error => { console.error(error); diff --git a/src/client/events/SIGTERM.js b/src/client/events/SIGTERM.js new file mode 100644 index 0000000..52daa75 --- /dev/null +++ b/src/client/events/SIGTERM.js @@ -0,0 +1,6 @@ +module.exports = { + name: 'SIGTERM', + async execute(client) { + process.emit('SIGINT'); + } +} \ No newline at end of file