Revert r100262 — wasn't the right place for it and other problems,
[lhc/web/wiklou.git] / maintenance / purgeStaleMemcachedText.php
index f183b5e..c4f5006 100644 (file)
@@ -14,8 +14,19 @@ function purgeStaleMemcachedText() {
        echo "Going to purge text entries from $latestReplicatedTextId to $maxTextId in $wgDBname\n";
 
        for ( $i = $latestReplicatedTextId; $i < $maxTextId; $i++ ) {
-               $key = wfMemcKey( 'revisiontext', 'textid', $i++ );
-               $wgMemc->delete( $key );
+               $key = wfMemcKey( 'revisiontext', 'textid', $i );
+               
+               while (1) {
+                       if (! $wgMemc->delete( $key ) ) {
+                               echo "Memcache delete for $key returned false\n";
+                       }
+                       if ( $wgMemc->get( $key ) ) {
+                               echo "There's still content in $key!\n";
+                       } else {
+                               break;
+                       }
+               }
+               
        }
 }