}
if ( $module->isWriteMode()
- && in_array( 'bot', $this->getUser()->getGroups() )
+ && $this->getUser()->isBot()
&& wfGetLB()->getServerCount() > 1
) {
$this->checkBotReadOnly();
}
// If a majority of replica DBs are too lagged then disallow writes
- $slaveCount = wfGetLB()->getServerCount() - 1;
- if ( $numLagged >= ceil( $slaveCount / 2 ) ) {
+ $replicaCount = wfGetLB()->getServerCount() - 1;
+ if ( $numLagged >= ceil( $replicaCount / 2 ) ) {
$laggedServers = implode( ', ', $laggedServers );
wfDebugLog(
'api-readonly',