mercredi 1 avril 2015

Restart MongoDB Connecton on crush - NodeJS

I have server implemented using nodejs. According to this post, I have one single connection (using native MongoDB) in my index.js file which connects to the MongoDB on server start.


I am using forever, so each time the server crushes this module restarts it.


My question is: What will happen if my mongo connection will crush? How can I handle this situation? How can I detect the crush programmatically? Should I restart it, if yes, how?


Aucun commentaire:

Enregistrer un commentaire