From 248204b8025c79645878ac156586443d4fdec69b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 17 Jul 2015 12:27:17 -0700 Subject: [PATCH] Removed squid purge in generateAndSaveThumb() * This is only useful for fixing thumbnails by manually making a thumb.php (non cache-handled) URL. This is what ?action=purge is for. The only edge case is when the thumb listings are out of sync with CDN, in which case ?action=purge does not work. Change-Id: I755532f08aa23e651f118b1efff937e3314805eb --- includes/filerepo/file/File.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 7ea658da8a..f9e1128a8e 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -1095,7 +1095,7 @@ abstract class File implements IDBAccessObject { * @return bool|MediaTransformOutput */ public function generateAndSaveThumb( $tmpFile, $transformParams, $flags ) { - global $wgUseSquid, $wgIgnoreImageErrors; + global $wgIgnoreImageErrors; $stats = RequestContext::getMain()->getStats(); @@ -1149,21 +1149,6 @@ abstract class File implements IDBAccessObject { Hooks::run( 'FileTransformed', array( $this, $thumb, $tmpThumbPath, $thumbPath ) ); } - // Purge. Useful in the event of Core -> Squid connection failure or squid - // purge collisions from elsewhere during failure. Don't keep triggering for - // "thumbs" which have the main image URL though (bug 13776) - if ( $wgUseSquid ) { - if ( !$thumb || $thumb->isError() || $thumb->getUrl() != $this->getURL() ) { - $starttime = microtime( true ); - - SquidUpdate::purge( array( $thumbUrl ) ); - - $stats->timing( 'media.thumbnail.generate.purge', microtime( true ) - $starttime ); - } - } - - - return $thumb; } -- 2.20.1