diff options
author | Evan Prodromou <evan@status.net> | 2010-01-28 14:27:35 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-28 14:27:35 -0500 |
commit | 74a03cbe1fecda9764f826c088331cc4ffbb9433 (patch) | |
tree | 0dba130c2da654f1e13c4ffe16d96a05550d9341 | |
parent | d5f86f7a8a113991f050425e411287da4f738ca2 (diff) |
always set up database_rw, regardless, so cached sessions work
-rw-r--r-- | index.php | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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; |