forked from GNUsocial/gnu-social
always set up database_rw, regardless, so cached sessions work
This commit is contained in:
parent
d5f86f7a8a
commit
74a03cbe1f
20
index.php
20
index.php
@ -152,16 +152,6 @@ function checkMirror($action_obj, $args)
|
|||||||
|
|
||||||
static $alwaysRW = array('session', 'remember_me');
|
static $alwaysRW = array('session', 'remember_me');
|
||||||
|
|
||||||
if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) {
|
|
||||||
if (is_array(common_config('db', 'mirror'))) {
|
|
||||||
// "load balancing", ha ha
|
|
||||||
$arr = common_config('db', 'mirror');
|
|
||||||
$k = array_rand($arr);
|
|
||||||
$mirror = $arr[$k];
|
|
||||||
} else {
|
|
||||||
$mirror = common_config('db', 'mirror');
|
|
||||||
}
|
|
||||||
|
|
||||||
// We ensure that these tables always are used
|
// We ensure that these tables always are used
|
||||||
// on the master DB
|
// on the master DB
|
||||||
|
|
||||||
@ -172,6 +162,16 @@ function checkMirror($action_obj, $args)
|
|||||||
$config['db']['table_'.$table] = 'rw';
|
$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
|
||||||
|
$arr = common_config('db', 'mirror');
|
||||||
|
$k = array_rand($arr);
|
||||||
|
$mirror = $arr[$k];
|
||||||
|
} else {
|
||||||
|
$mirror = common_config('db', 'mirror');
|
||||||
|
}
|
||||||
|
|
||||||
// everyone else uses the mirror
|
// everyone else uses the mirror
|
||||||
|
|
||||||
$config['db']['database'] = $mirror;
|
$config['db']['database'] = $mirror;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user