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

Reconnect to mongo indefinitely. #7880

Merged
merged 2 commits into from Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions packages/mongo/mongo_driver.js
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/mongo/package.js
Expand Up @@ -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({
Expand Down