Removed squid purge in generateAndSaveThumb()
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Jul 2015 19:27:17 +0000 (12:27 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Jul 2015 19:27:17 +0000 (12:27 -0700)
* 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

index 7ea658d..f9e1128 100644 (file)
@@ -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;
        }