Merge "ResourceLoaderStartUpModule: Use hashMtime to detect config changes"
[lhc/web/wiklou.git] / includes / objectcache / MemcachedPeclBagOStuff.php
index 748c423..18546d4 100644 (file)
@@ -37,6 +37,8 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff {
         *   - compress_threshold:  The minimum size an object must be before it is compressed
         *   - timeout:             The read timeout in microseconds
         *   - connect_timeout:     The connect timeout in seconds
+        *   - retry_timeout:       Time in seconds to wait before retrying a failed connect attempt
+        *   - server_failure_limit:  Limit for server connect failures before it is removed
         *   - serializer:          May be either "php" or "igbinary". Igbinary produces more compact
         *                          values, but serialization is much slower unless the php.ini option
         *                          igbinary.compact_strings is off.
@@ -61,6 +63,14 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff {
                        $params['serializer'] = 'php';
                }
 
+               if ( isset( $params['retry_timeout'] ) ) {
+                       $this->client->setOption( Memcached::OPT_RETRY_TIMEOUT, $params['retry_timeout'] );
+               }
+
+               if ( isset( $params['server_failure_limit'] ) ) {
+                       $this->client->setOption( Memcached::OPT_SERVER_FAILURE_LIMIT, $params['server_failure_limit'] );
+               }
+
                // The compression threshold is an undocumented php.ini option for some
                // reason. There's probably not much harm in setting it globally, for
                // compatibility with the settings for the PHP client.
@@ -166,17 +176,6 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff {
                return $this->checkResult( $key, parent::add( $key, $value, $exptime ) );
        }
 
-       /**
-        * @param $key string
-        * @param $value int
-        * @param $exptime
-        * @return Mixed
-        */
-       public function replace( $key, $value, $exptime = 0 ) {
-               $this->debugLog( "replace($key)" );
-               return $this->checkResult( $key, parent::replace( $key, $value, $exptime ) );
-       }
-
        /**
         * @param $key string
         * @param $value int