Last active
February 29, 2016 22:37
-
-
Save scotthernandez/fe0c0f37ff4a65ab9604 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/mongo/client/dbclientinterface.h b/src/mongo/client/dbclientinterface.h | |
index a4e23c3..3e97358 100644 | |
--- a/src/mongo/client/dbclientinterface.h | |
+++ b/src/mongo/client/dbclientinterface.h | |
@@ -1249,8 +1249,14 @@ protected: | |
// throws SocketException if in failed state and not reconnecting or if waiting to reconnect | |
void checkConnection() { | |
- if (_failed) | |
+ if (_failed) { | |
_checkConnection(); | |
+ } | |
+ | |
+ if (autoReconnect && !isStillConnected()) { | |
+ _failed = true; | |
+ _checkConnection(); | |
+ } | |
} | |
std::map<std::string, BSONObj> authCache; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment