Skip to content

Instantly share code, notes, and snippets.

@hmpmarketing
Created September 25, 2018 09:22
Show Gist options
  • Select an option

  • Save hmpmarketing/343f193aace6d1f0c8a6f7ae13dc29cd to your computer and use it in GitHub Desktop.

Select an option

Save hmpmarketing/343f193aace6d1f0c8a6f7ae13dc29cd to your computer and use it in GitHub Desktop.
function handleSignals(){
helpers.log(p_id,`------------SIGINT Detected!1-------------`);
request(`${webdomain}/api/p/end/${p_id}`,{
method: 'POST',
form: {
error: '',
msg:'SIGINT DETECTED!'
},
maxAttempts: Infinity,
retryDelay: api_retry_delay,
retryStrategy: helpers.retryApiCallStrategy
})
helpers.log(p_id,`------------SIGINT Detected!2-------------`);
}
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