Last active
January 9, 2022 15:39
-
-
Save lakinmohapatra/11d571fd3bf88dd4d5cca979a06171bb to your computer and use it in GitHub Desktop.
Create app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.on('SIGINT', function(){ console.log("SIGINT"); terminate() }); | |
process.on('SIGTERM', function(){ console.log("SIGTERM"); terminate() }); | |
var string = "a"; | |
var terminate = function(){ | |
console.log("shuting down..."); | |
string = "b"; | |
setTimeout(function(){ | |
console.log("Terminated!"); | |
process.exit(); | |
}, 1000 * 5); | |
} | |
setInterval(function(){ | |
console.log(string); | |
}, 500) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment