meanio icon indicating copy to clipboard operation
meanio copied to clipboard

Implement a retry capability when connecting to MongoDB

Open dazwin opened this issue 9 years ago • 1 comments

This allows configuration of a retry loop when connecting to Mongo. You can configure as follows:

module.exports = {
  db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-dev',
  dbOptions: {
    retry: {
      times: 5,
      interval: 1000
    }
  },
  ...

Options are per async.retry (interval is in ms). Default behavior is to not retry (i.e. current behavior).

dazwin avatar Aug 06 '15 18:08 dazwin

This is a nice addition, thanks!

timelf123 avatar Mar 04 '16 02:03 timelf123