From: Aaron Schulz Date: Wed, 29 Nov 2017 05:59:28 +0000 (-0800) Subject: objectcache: use INTERIM_KEY_TTL constant in WANObjectCache for readability X-Git-Tag: 1.31.0-rc.0~1359^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=ee14393358109fff6023855f6d194016b6332bb0;p=lhc%2Fweb%2Fwiklou.git objectcache: use INTERIM_KEY_TTL constant in WANObjectCache for readability Change-Id: I13936397def11a13849fe14491b752dd797f6759 --- diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 727e3c12f4..db27e42e1e 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -111,6 +111,9 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { /** Seconds to keep dependency purge keys around */ const CHECK_KEY_TTL = self::TTL_YEAR; + /** Seconds to keep interim value keys for tombstoned keys around */ + const INTERIM_KEY_TTL = 1; + /** Seconds to keep lock keys around */ const LOCK_TTL = 10; /** Default remaining TTL at which to consider pre-emptive regeneration */ @@ -1009,7 +1012,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { $isTombstone = ( $curTTL !== null && $value === false ); if ( $isTombstone && $lockTSE <= 0 ) { // Use the INTERIM value for tombstoned keys to reduce regeneration load - $lockTSE = 1; + $lockTSE = self::INTERIM_KEY_TTL; } // Assume a key is hot if requested soon after invalidation $isHot = ( $curTTL !== null && $curTTL <= 0 && abs( $curTTL ) <= $lockTSE );