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

@ -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);

View File

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