Skip to content

Instantly share code, notes, and snippets.

@hmpmarketing
Created September 25, 2018 10:07
Show Gist options
  • Select an option

  • Save hmpmarketing/78fd32d8b5cd47da7ae4271e0c76ff73 to your computer and use it in GitHub Desktop.

Select an option

Save hmpmarketing/78fd32d8b5cd47da7ae4271e0c76ff73 to your computer and use it in GitHub Desktop.
function handleSignals(){
helpers.log(p_id,`------------SIGINT Detected1!-------------`);
helpers.log(p_id,`------------SIGINT Detected2!-------------`);
req.post(`${webdomain}/api/p_id/end/${p_id}`, {form:{error:'',msg:'SIGINT DETECTED!'}}, function(err, res, body) {
helpers.log(p_id,`------------SIGINT Detected3!-------------`);
});
helpers.log(p_id,`------------SIGINT Detected4!-------------`);
}
process.on('SIGINT', handleSignals)
process.on('SIGTERM', handleSignals)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment