From: Sergio Santoro Date: Thu, 16 Oct 2014 18:43:38 +0000 (+0200) Subject: SqlBagOStuff: fix percentage in deleteObjectsExpiringBefore() X-Git-Tag: 1.31.0-rc.0~13546^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=4c79d2e7e44cfd8242d0e2e2dea92a2cf74d8628;p=lhc%2Fweb%2Fwiklou.git SqlBagOStuff: fix percentage in deleteObjectsExpiringBefore() Partial deletion percentage progess was computed using $remainingSeconds. This is incorrect since $remainingSeconds is going to *decrease* ( instead of increase ) while the process continues. The correct implementation uses 'processed seconds' instead. Change-Id: Ic745f6e8375a85da543de36703fad6d31f62ea90 --- diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 3b0f8165d3..d8d86dbae3 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -621,7 +621,8 @@ class SqlBagOStuff extends BagOStuff { if ( $remainingSeconds > $totalSeconds ) { $totalSeconds = $remainingSeconds; } - $percent = ( $i + $remainingSeconds / $totalSeconds ) + $processedSeconds = $totalSeconds - $remainingSeconds; + $percent = ( $i + $processedSeconds / $totalSeconds ) / $this->shards * 100; } $percent = ( $percent / $this->numServers )