Added SIGTERM event

This commit is contained in:
Christer Warén 2021-09-02 19:18:20 +03:00
parent 45b23722fa
commit 430e0f9e51
2 changed files with 10 additions and 0 deletions

View File

@ -76,6 +76,10 @@ class RadioClient extends Client {
require(`${events}SIGINT`).execute(this); require(`${events}SIGINT`).execute(this);
}); });
process.on('SIGTERM', () => {
require(`${events}SIGTERM`).execute(this);
});
this.on("error", error => { this.on("error", error => {
console.error(error); console.error(error);
}); });

View File

@ -0,0 +1,6 @@
module.exports = {
name: 'SIGTERM',
async execute(client) {
process.emit('SIGINT');
}
}