From d6b9ab35a87e657ca28bb9d5f21a76f3705eceba Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 7 Sep 2012 20:04:11 +0200 Subject: [PATCH] Removed purgeStaleMemcachedText.php and refreshImageCount.php scripts Both are Wikimedia-specific scripts and are now obsolete: - purgeStaleMemcachedText.php is a script to purge memcached entries for revision text older than an hardcoded date of December 2012. This script is already in the WikimediaMaintenance extension. - refreshImageCount.php is a hack to fix a schema update script dating to 2006. Change-Id: I2ae469063eba502e662f80c38d5816c371550352 --- maintenance/purgeStaleMemcachedText.php | 53 ------------------------ maintenance/refreshImageCount.php | 54 ------------------------- 2 files changed, 107 deletions(-) delete mode 100644 maintenance/purgeStaleMemcachedText.php delete mode 100644 maintenance/refreshImageCount.php diff --git a/maintenance/purgeStaleMemcachedText.php b/maintenance/purgeStaleMemcachedText.php deleted file mode 100644 index 225400f1f1..0000000000 --- a/maintenance/purgeStaleMemcachedText.php +++ /dev/null @@ -1,53 +0,0 @@ -selectField( 'text', 'max(old_id)' ); - $latestReplicatedTextId = $db->selectField( array( 'recentchanges', 'revision' ), 'rev_text_id', - array( 'rev_id = rc_this_oldid', "rc_timestamp < '20101225183000'"), 'purgeStaleMemcachedText', - array( 'ORDER BY' => 'rc_timestamp DESC' ) ); - $latestReplicatedTextId -= 100; # A bit of paranoia - - echo "Going to purge text entries from $latestReplicatedTextId to $maxTextId in $wgDBname\n"; - - for ( $i = $latestReplicatedTextId; $i < $maxTextId; $i++ ) { - $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; - } - } - - } -} - -purgeStaleMemcachedText(); - diff --git a/maintenance/refreshImageCount.php b/maintenance/refreshImageCount.php deleted file mode 100644 index be6bd18dac..0000000000 --- a/maintenance/refreshImageCount.php +++ /dev/null @@ -1,54 +0,0 @@ -mDescription = "Resets ss_image count, forcing slaves to pick it up."; - } - - public function execute() { - $dbw = wfGetDB( DB_MASTER ); - - // Load the current value from the master - $count = $dbw->selectField( 'site_stats', 'ss_images' ); - - $this->output( wfWikiID() . ": forcing ss_images to $count\n" ); - - // First set to NULL so that it changes on the master - $dbw->update( 'site_stats', - array( 'ss_images' => null ), - array( 'ss_row_id' => 1 ) ); - - // Now this update will be forced to go out - $dbw->update( 'site_stats', - array( 'ss_images' => $count ), - array( 'ss_row_id' => 1 ) ); - } -} - -$maintClass = "RefreshImageCount"; -require_once( RUN_MAINTENANCE_IF_MAIN ); - -- 2.20.1