You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a CF node app running and I have some functions that need to be called as a part of cleanup on app exit. I have called those cleanup functions on process.exit event. But unfortunately, I am not seeing the clean up happening. Is there any extra parameter that I need to set for this cleanup function to be executed.This is the event listener and cleanup functions I have written
function exitHandler(options, err) {
console.log("INSIDE EXITHANDLER")
if (options.cleanup) console.log("I am Dead")
if (err) console.log(err.stack);
if (options.exit) process.exit();
}
//do something when app is closing
process.on('exit', exitHandler.bind(null,{cleanup:true}));
//catches ctrl+c event
process.on('SIGINT', exitHandler.bind(null, {exit:true}));
process.on('SIGTERM', exitHandler.bind(null, {exit:true}));
// catches "kill pid" (for example: nodemon restart)
process.on('SIGUSR1', exitHandler.bind(null, {exit:true}));
process.on('SIGUSR2', exitHandler.bind(null, {exit:true}));
//catches uncaught exceptions
process.on('uncaughtException', exitHandler.bind(null, {exit:true}));
The text was updated successfully, but these errors were encountered:
We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.
The labels on this github issue will be updated when the story is started.
hi @sumanth10! sorry to hear you're having trouble. I think you might have better luck getting help with your particular question on the Cloud Foundry Slack https://cloudfoundry.slack.com. #cf-users or the #general channel might be good starting points. If you find out that the issue is something we need to fix or add to the docs, please feel free to come back and file another issue or PR.
I have a CF node app running and I have some functions that need to be called as a part of cleanup on app exit. I have called those cleanup functions on process.exit event. But unfortunately, I am not seeing the clean up happening. Is there any extra parameter that I need to set for this cleanup function to be executed.This is the event listener and cleanup functions I have written
The text was updated successfully, but these errors were encountered: