Don't keep puring squids for images where no thumb is needed (bug 13776)
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 2 May 2008 21:29:05 +0000 (21:29 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 2 May 2008 21:29:05 +0000 (21:29 +0000)
includes/filerepo/File.php

index 5d2db79..d1b0cd5 100644 (file)
@@ -546,8 +546,11 @@ abstract class File {
                                        $thumb = $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
                                }
                        }
-
-                       if ( $wgUseSquid ) {
+                       
+                       // 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 && !$thumb->isError() && $thumb->url != $this->getURL() ) {
                                SquidUpdate::purge( array( $thumbUrl ) );
                        }
                } while (false);