From: Brian Wolff Date: Mon, 30 Jun 2014 00:24:18 +0000 (-0300) Subject: Do thumb attempt-failures limitting via sha1 instead of name. X-Git-Tag: 1.31.0-rc.0~15095^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=e3bb925b9c75e473e2d94e63b32045ce4cafea43;p=lhc%2Fweb%2Fwiklou.git Do thumb attempt-failures limitting via sha1 instead of name. Otherwise if there is a broken file, and somebody fixes the file, it could take an hour before thumbs are generated again. This might confuse the user, and they may revert back to the broken version thinking their fix didn't work. Originally reported by Fae on wiki. Change-Id: I024702391e5f7ccf10a406a29485601f64069405 --- diff --git a/thumb.php b/thumb.php index c611dc3ca7..c0042c2c95 100644 --- a/thumb.php +++ b/thumb.php @@ -367,7 +367,7 @@ function wfGenerateThumbnail( File $file, array $params, $thumbName, $thumbPath global $wgMemc, $wgAttemptFailureEpoch; $key = wfMemcKey( 'attempt-failures', $wgAttemptFailureEpoch, - $file->getRepo()->getName(), md5( $file->getName() ), md5( $thumbName ) ); + $file->getRepo()->getName(), $file->getSha1(), md5( $thumbName ) ); // Check if this file keeps failing to render if ( $wgMemc->get( $key ) >= 4 ) {