Replace unused LoadBalancer::waitTimeout() method with a config setting
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 7 Sep 2016 04:57:20 +0000 (21:57 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 7 Sep 2016 04:57:20 +0000 (21:57 -0700)
Change-Id: Ide390738be0ff537580002501c380a0507dab1e5

includes/db/loadbalancer/LoadBalancer.php

index 71286a9..16774b7 100644 (file)
@@ -94,6 +94,7 @@ class LoadBalancer {
         *  - servers : Required. Array of server info structures.
         *  - loadMonitor : Name of a class used to fetch server lag and load.
         *  - readOnlyReason : Reason the master DB is read-only if so [optional]
+        *  - waitTimeout : Maximum time to wait for replicas for consistency [optional]
         *  - srvCache : BagOStuff object [optional]
         *  - wanCache : WANObjectCache object [optional]
         * @throws MWException
@@ -103,7 +104,9 @@ class LoadBalancer {
                        throw new MWException( __CLASS__ . ': missing servers parameter' );
                }
                $this->mServers = $params['servers'];
-               $this->mWaitTimeout = self::POS_WAIT_TIMEOUT;
+               $this->mWaitTimeout = isset( $params['waitTimeout'] )
+                       ? $params['waitTimeout']
+                       : self::POS_WAIT_TIMEOUT;
 
                $this->mReadIndex = -1;
                $this->mWriteIndex = -1;
@@ -1413,14 +1416,6 @@ class LoadBalancer {
                return $fnames;
        }
 
-       /**
-        * @param mixed $value
-        * @return mixed
-        */
-       public function waitTimeout( $value = null ) {
-               return wfSetVar( $this->mWaitTimeout, $value );
-       }
-
        /**
         * @note This method will trigger a DB connection if not yet done
         * @param string|bool $wiki Wiki ID, or false for the current wiki