const signalTraps = ['SIGTERM', 'SIGINT', 'SIGUSR2'];
signalTraps.forEach(type => {
process.once(type, async () => {
try {
console.log("On Exist");
// perform operations here
// await consumer.disconnect()
} finally {
process.kill(process.pid, type)
}
})
})
Created
September 15, 2022 16:08
-
-
Save raviagheda/ec1a0a8dcda968768b58102c1d6a2009 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment