} else {
$server['slave'] = true;
}
+ $server += [ 'flags' => DBO_DEFAULT ];
}
} else {
global $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, $wgDBtype, $wgDebugDumpSql;
] ];
}
- return new LoadBalancer( [
- 'servers' => $servers,
- 'loadMonitor' => $this->loadMonitorClass,
- 'readOnlyReason' => $this->readOnlyReason,
- 'trxProfiler' => $this->trxProfiler
- ] );
+ return $this->newLoadBalancer( $servers );
}
/**
throw new MWException( __METHOD__ . ": Unknown cluster \"$cluster\"" );
}
- return new LoadBalancer( [
- 'servers' => $wgExternalServers[$cluster],
- 'loadMonitor' => $this->loadMonitorClass,
- 'readOnlyReason' => $this->readOnlyReason,
- 'trxProfiler' => $this->trxProfiler
- ] );
+ return $this->newLoadBalancer( $wgExternalServers[$cluster] );
}
/**
return $this->extLBs[$cluster];
}
+ private function newLoadBalancer( array $servers ) {
+ return new LoadBalancer( [
+ 'servers' => $servers,
+ 'loadMonitor' => $this->loadMonitorClass,
+ 'readOnlyReason' => $this->readOnlyReason,
+ 'trxProfiler' => $this->trxProfiler,
+ 'srvCache' => $this->srvCache,
+ 'wanCache' => $this->wanCache
+ ] );
+ }
+
/**
* Execute a function for each tracked load balancer
* The callback is called with the load balancer as the first parameter,