objectcache: make MediumSpecificBagOStuff::mergeViaCas() handle negative TTLs
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 9 Aug 2019 22:35:28 +0000 (15:35 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 9 Aug 2019 22:35:28 +0000 (15:35 -0700)
Change-Id: Ieb503cdb5d0849be7b7be21780ae552ab937ae80

includes/libs/objectcache/MediumSpecificBagOStuff.php

index fe17628..5e9ebca 100644 (file)
@@ -323,7 +323,7 @@ abstract class MediumSpecificBagOStuff extends BagOStuff {
                        unset( $currentValue ); // free RAM in case the value is large
 
                        $this->clearLastError();
-                       if ( $value === false ) {
+                       if ( $value === false || $exptime < 0 ) {
                                $success = true; // do nothing
                        } elseif ( $hadNoCurrentValue ) {
                                // Try to create the key, failing if it gets created in the meantime