X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=blobdiff_plain;f=includes%2Fapi%2FApiMain.php;h=ae3f3f2458fabea074b8e2e2c3dd7c28dfc4a1ef;hb=6244b8c23a7c15be3d9de2130d290a2437bb6587;hp=22b079dee10e669f73c87ed7e1a7a702f209b730;hpb=fd8a5d468934398595874783fa75ae2bf1b2b482;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 22b079dee1..ae3f3f2458 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -1299,7 +1299,7 @@ class ApiMain extends ApiBase { } if ( $module->isWriteMode() - && in_array( 'bot', $this->getUser()->getGroups() ) + && $this->getUser()->isBot() && wfGetLB()->getServerCount() > 1 ) { $this->checkBotReadOnly(); @@ -1322,9 +1322,9 @@ class ApiMain extends ApiBase { } } - // If a majority of slaves are too lagged then disallow writes - $slaveCount = wfGetLB()->getServerCount() - 1; - if ( $numLagged >= ceil( $slaveCount / 2 ) ) { + // If a majority of replica DBs are too lagged then disallow writes + $replicaCount = wfGetLB()->getServerCount() - 1; + if ( $numLagged >= ceil( $replicaCount / 2 ) ) { $laggedServers = implode( ', ', $laggedServers ); wfDebugLog( 'api-readonly',