mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Reconnect to mongo indefinitely. (#7880)
* Reconnect to mongo indefinitely. A fix for https://github.com/meteor/meteor/issues/7822 It seems the driver now always autoReconnects, but only for 30s. To get the old (sensible) behavior of endlessly reconnecting, we set `reconnectTries` to 0. * Releasing an rc of mongo package
This commit is contained in:
@@ -130,15 +130,15 @@ MongoConnection = function (url, options) {
|
||||
self._observeMultiplexers = {};
|
||||
self._onFailoverHook = new Hook;
|
||||
|
||||
var mongoOptions = _.extend({db: {safe: true}, server: {}, replSet: {}},
|
||||
Mongo._connectionOptions);
|
||||
|
||||
// Set autoReconnect to true, unless passed on the URL. Why someone
|
||||
// would want to set autoReconnect to false, I'm not really sure, but
|
||||
// keeping this for backwards compatibility for now.
|
||||
if (!(/[\?&]auto_?[rR]econnect=/.test(url))) {
|
||||
mongoOptions.server.auto_reconnect = true;
|
||||
}
|
||||
var mongoOptions = _.extend({
|
||||
db: { safe: true },
|
||||
// Set reconnectTries to 0 which means keep trying to reconnect forever,
|
||||
// rather than the default of losing the connection permanently after 30
|
||||
// retries (separated by 1000ms).
|
||||
server: { reconnectTries: 0 },
|
||||
replSet: {}
|
||||
},
|
||||
Mongo._connectionOptions);
|
||||
|
||||
// Disable the native parser by default, unless specifically enabled
|
||||
// in the mongo URL.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
Package.describe({
|
||||
summary: "Adaptor for using MongoDB and Minimongo over DDP",
|
||||
version: '1.1.12_1'
|
||||
version: '1.1.12-2-rc.0'
|
||||
});
|
||||
|
||||
Npm.depends({
|
||||
|
||||
Reference in New Issue
Block a user