Skip to content

Commit

Permalink
Correctly set mongo rs readPreference (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfanchon committed Dec 3, 2015
1 parent a480662 commit f5509f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions module/Rubedo/src/Rubedo/Mongo/DataAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,9 @@ public function getAdapter($mongo = null, $db = null)
$adapter = new \MongoClient($mongo);
} else {
if (!self::$_readPreference) {
$mongo .= "?readPreference=nearest";
} else {
$mongo .= self::$_readPreference;
self::$_readPreference = "nearest";
}
$mongo .= "?readPreference=".self::$_readPreference;
$adapter = new \MongoClient($mongo,array('replicaSet' => self::$_replicaSetName));
}
} catch (\Exception $e) {
Expand Down

0 comments on commit f5509f0

Please sign in to comment.