Merge "mw.Upload.BookletLayout: Don't explode when the API call fails with 'exception'"
[lhc/web/wiklou.git] / includes / libs / objectcache / WANObjectCache.php
index 8bdafcf..4aa868e 100644 (file)
@@ -311,11 +311,9 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                                : false;
                        if ( $purge === false ) {
                                // Key is not set or invalid; regenerate
-                               $this->cache->add( $timeKey,
-                                       $this->makePurgeValue( $now, self::HOLDOFF_TTL ),
-                                       self::CHECK_KEY_TTL
-                               );
-                               $purge = array( self::FLD_TIME => $now, self::FLD_HOLDOFF => self::HOLDOFF_TTL );
+                               $newVal = $this->makePurgeValue( $now, self::HOLDOFF_TTL );
+                               $this->cache->add( $timeKey, $newVal, self::CHECK_KEY_TTL );
+                               $purge = self::parsePurgeValue( $newVal );
                        }
                        $purgeValues[] = $purge;
                }
@@ -452,7 +450,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         *
         * Example usage:
         * @code
-        *     $dbw->begin(); // start of request
+        *     $dbw->begin( __METHOD__ ); // start of request
         *     ... <execute some stuff> ...
         *     // Update the row in the DB
         *     $dbw->update( ... );
@@ -462,7 +460,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         *         $cache->delete( $key );
         *     } );
         *     ... <execute some stuff> ...
-        *     $dbw->commit(); // end of request
+        *     $dbw->commit( __METHOD__ ); // end of request
         * @endcode
         *
         * The $ttl parameter can be used when purging values that have not actually changed