0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-661 shell keeps going if can't get its uri - to be compatible with 1.2

This commit is contained in:
Aaron 2010-02-23 13:54:34 -08:00
parent 804a3917ee
commit 211ae74188

View File

@ -697,10 +697,11 @@ namespace mongo {
return;
}
BSONObj info;
uassert( 13010, "whatsmyuri failed", c.runCommand( "admin", BSON( "whatsmyuri" << 1 ), info ) );
// There's no way to explicitly disconnect a DBClientConnection, but we might allocate
// a new uri on automatic reconnect. So just store one uri per connection.
_allMyUris[ &c ] = info[ "you" ].str();
if ( c.runCommand( "admin", BSON( "whatsmyuri" << 1 ), info ) ) {
// There's no way to explicitly disconnect a DBClientConnection, but we might allocate
// a new uri on automatic reconnect. So just store one uri per connection.
_allMyUris[ &c ] = info[ "you" ].str();
}
}
}
}