Skip to content

Commit

Permalink
Remove mongodb cluseter and revert to just one mongodb server
Browse files Browse the repository at this point in the history
  • Loading branch information
bxjx committed Feb 14, 2013
1 parent 26e6667 commit 3c4166f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/DGM/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function register(Application $app)
$app['config'] = $this->config;

$app['db'] = $app->share(function(Application $app) {
return new MongoDB($app['config']['dbname'], $app['config']['db'], $app['config']['dbOptions']);
return new MongoDB($app['config']['dbname'], $app['config']['db']);
});

$app['budgets'] = $app->share(function(Application $app) {
Expand Down
4 changes: 2 additions & 2 deletions src/DGM/Database/MongoDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class MongoDB {

public $mongoDb;

public function __construct($dbname, $connectionString, $options)
public function __construct($dbname, $connectionString)
{
$this->mongo = new \Mongo($connectionString, $options);
$this->mongo = new \Mongo($connectionString);
$this->mongoDb = $this->mongo->selectDb($dbname);
}

Expand Down
3 changes: 1 addition & 2 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
'gitHash' => `git rev-parse HEAD`,
'buildId' => substr(`git rev-parse HEAD`, 0, 16),
'categories' => Util::loadJSONFile(__DIR__ . '/../resources/categories.json'),
'db' => 'mongodb://db-production2,db-production1',
'dbOptions' => array("replicaSet" => "dbproduction"),
'db' => 'mongodb://db-production1',
'dbname' => 'budget2012',
'assetHost' => 'http://9d13444fc29e94942058-e7acde355f751313b3672e46489208df.r75.cf1.rackcdn.com'
];
Expand Down

0 comments on commit 3c4166f

Please sign in to comment.