Created
September 25, 2018 09:22
-
-
Save hmpmarketing/343f193aace6d1f0c8a6f7ae13dc29cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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