Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/129725

Change subject: Randomize thumbnail failure key TTL a bit to avoid stampedes
......................................................................

Randomize thumbnail failure key TTL a bit to avoid stampedes

Change-Id: Ibf268b646a9eb2acfaa649d634c5278133091158
---
M thumb.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/129725/1

diff --git a/thumb.php b/thumb.php
index 707f1e2..9431089 100644
--- a/thumb.php
+++ b/thumb.php
@@ -374,7 +374,7 @@
        register_shutdown_function( function() use ( &$done, $key ) {
                if ( !$done ) { // transform() gave a fatal
                        global $wgMemc;
-                       $wgMemc->incrWithInit( $key, 3600 );
+                       $wgMemc->incrWithInit( $key, 3600 + mt_rand( 0, 300 ) );
                }
        } );
 
@@ -412,7 +412,7 @@
        $done = true; // no PHP fatal occured
 
        if ( !$thumb || $thumb->isError() ) {
-               $wgMemc->incrWithInit( $key, 3600 );
+               $wgMemc->incrWithInit( $key, 3600 + mt_rand( 0, 300 ) );
        }
 
        return array( $thumb, $errorHtml );

-- 
To view, visit https://gerrit.wikimedia.org/r/129725
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf268b646a9eb2acfaa649d634c5278133091158
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to