Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close connection to mongodb for kill signal #2

Open
bassemZohdy opened this issue Sep 2, 2015 · 0 comments
Open

Close connection to mongodb for kill signal #2

bassemZohdy opened this issue Sep 2, 2015 · 0 comments

Comments

@bassemZohdy
Copy link
Owner

close connections to database mongodb if the admin killed rest service using Ctrl+C refer to the below code & links:
process.on('SIGINT', function() {
console.log('Got SIGINT. Press Control-D to exit.');
});
http://stackoverflow.com/questions/8813838/properly-close-mongooses-connection-once-youre-done
http://stackoverflow.com/questions/19371821/do-i-need-to-manually-close-a-mongoose-connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant