objectcache: Add $holdoff parameter to WANObjectCache::touchCheckKey()
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 2 Dec 2015 15:47:05 +0000 (15:47 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 2 Dec 2015 21:33:05 +0000 (21:33 +0000)
Change-Id: I14b6d7660b34271826b77875c660c34343712648

includes/libs/objectcache/WANObjectCache.php

index 1c900cd..21d6885 100644 (file)
@@ -560,17 +560,18 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         * @see WANObjectCache::resetCheckKey()
         *
         * @param string $key Cache key
+        * @param int $holdoff HOLDOFF_TTL or HOLDOFF_NONE constant
         * @return bool True if the item was purged or not found, false on failure
         */
-       final public function touchCheckKey( $key ) {
+       final public function touchCheckKey( $key, $holdoff = self::HOLDOFF_TTL ) {
                $key = self::TIME_KEY_PREFIX . $key;
                // Update the local datacenter immediately
                $ok = $this->cache->set( $key,
-                       $this->makePurgeValue( microtime( true ), self::HOLDOFF_TTL ),
+                       $this->makePurgeValue( microtime( true ), $holdoff ),
                        self::CHECK_KEY_TTL
                );
                // Publish the purge to all datacenters
-               return $this->relayPurge( $key, self::CHECK_KEY_TTL, self::HOLDOFF_TTL ) && $ok;
+               return $this->relayPurge( $key, self::CHECK_KEY_TTL, $holdoff ) && $ok;
        }
 
        /**