Apply live hack from Wikimedia code base -- remove unused commented-out checker patte...
[lhc/web/wiklou.git] / includes / LoadBalancer.php
index 6efcbdd..185c6d3 100644 (file)
@@ -20,7 +20,7 @@ class LoadBalancer {
         * 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 )
        {
@@ -432,8 +432,7 @@ class LoadBalancer {
                return $db;
        }
 
-       function reportConnectionError( &$conn )
-       {
+       function reportConnectionError( &$conn ) {
                $fname = 'LoadBalancer::reportConnectionError';
                wfProfileIn( $fname );
                # Prevent infinite recursion
@@ -556,9 +555,9 @@ class LoadBalancer {
        /* 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();
                        }
                }