X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FMemcachedBagOStuff.php;h=f7bf86b905a856561920b617b828d24fd293065f;hb=4ac20c2c3b18ffc70fbb2518d8ea6bd16a7bafd8;hp=596744107c254831d4214152efaa99dedf5606a3;hpb=4a975b8099ee11b15421d03be02206935a8422f1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/MemcachedBagOStuff.php b/includes/libs/objectcache/MemcachedBagOStuff.php index 596744107c..f7bf86b905 100644 --- a/includes/libs/objectcache/MemcachedBagOStuff.php +++ b/includes/libs/objectcache/MemcachedBagOStuff.php @@ -30,6 +30,12 @@ class MemcachedBagOStuff extends BagOStuff { /** @var MemcachedClient|Memcached */ protected $client; + function __construct( array $params ) { + parent::__construct( $params ); + + $this->attrMap[self::ATTR_SYNCWRITES] = self::QOS_SYNCWRITES_BE; // unreliable + } + /** * Fill in some defaults for missing keys in $params. * @@ -37,13 +43,11 @@ class MemcachedBagOStuff extends BagOStuff { * @return array */ protected function applyDefaultParams( $params ) { - if ( !isset( $params['compress_threshold'] ) ) { - $params['compress_threshold'] = 1500; - } - if ( !isset( $params['connect_timeout'] ) ) { - $params['connect_timeout'] = 0.5; - } - return $params; + return $params + [ + 'compress_threshold' => 1500, + 'connect_timeout' => 0.5, + 'debug' => false + ]; } protected function doGet( $key, $flags = 0 ) { @@ -133,7 +137,7 @@ class MemcachedBagOStuff extends BagOStuff { ); if ( $charsLeft < 0 ) { - return $keyspace . ':##' . md5( implode( ':', $args ) ); + return $keyspace . ':BagOStuff-long-key:##' . md5( implode( ':', $args ) ); } return $keyspace . ':' . implode( ':', $args );