From e3bb925b9c75e473e2d94e63b32045ce4cafea43 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sun, 29 Jun 2014 21:24:18 -0300 Subject: [PATCH] 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 --- thumb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) { -- 2.20.1