* Scale polling time so that under overload conditions, the database server
* receives a SHOW STATUS query at an average interval of this many microseconds
*/
- const AVG_STATUS_POLL = 2000;
+ const AVG_STATUS_POLL = 30000;
function __construct( $servers, $failFunction = false, $waitTimeout = 10, $waitForMasterNow = false )
{
return $db;
}
- function reportConnectionError( &$conn )
- {
+ function reportConnectionError( &$conn ) {
$fname = 'LoadBalancer::reportConnectionError';
wfProfileIn( $fname );
# Prevent infinite recursion
/* Issue COMMIT only on master, only if queries were done on connection */
function commitMasterChanges() {
// Always 0, but who knows.. :)
- $i = $this->getWriterIndex;
+ $i = $this->getWriterIndex();
if (array_key_exists($i,$this->mConnections)) {
- if ($this->mConnections[$i]->lastQuery != '') {
+ if ($this->mConnections[$i]->lastQuery() != '') {
$this->mConnections[$i]->immediateCommit();
}
}