Commit 74a03cbe authored by Evan Prodromou's avatar Evan Prodromou

always set up database_rw, regardless, so cached sessions work

parent d5f86f7a
......@@ -152,6 +152,16 @@ function checkMirror($action_obj, $args)
static $alwaysRW = array('session', 'remember_me');
// We ensure that these tables always are used
// on the master DB
$config['db']['database_rw'] = $config['db']['database'];
$config['db']['ini_rw'] = INSTALLDIR.'/classes/statusnet.ini';
foreach ($alwaysRW as $table) {
$config['db']['table_'.$table] = 'rw';
}
if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) {
if (is_array(common_config('db', 'mirror'))) {
// "load balancing", ha ha
......@@ -162,16 +172,6 @@ function checkMirror($action_obj, $args)
$mirror = common_config('db', 'mirror');
}
// We ensure that these tables always are used
// on the master DB
$config['db']['database_rw'] = $config['db']['database'];
$config['db']['ini_rw'] = INSTALLDIR.'/classes/statusnet.ini';
foreach ($alwaysRW as $table) {
$config['db']['table_'.$table] = 'rw';
}
// everyone else uses the mirror
$config['db']['database'] = $mirror;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment