jenkins-bot has submitted this change and it was merged.

Change subject: Avoid showing crazy staleness times at ActiveUsers
......................................................................


Avoid showing crazy staleness times at ActiveUsers

* Also do the query more aggressively on small wikis

Change-Id: I089b2f69d03bb289035be11ccfe4937931904d25
---
M includes/specials/SpecialActiveusers.php
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  BryanDavis: Looks good to me, but someone else must approve
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialActiveusers.php 
b/includes/specials/SpecialActiveusers.php
index 641c046..1fed516 100644
--- a/includes/specials/SpecialActiveusers.php
+++ b/includes/specials/SpecialActiveusers.php
@@ -242,7 +242,7 @@
                        array( 'activeusers-intro', 
$this->getLanguage()->formatNum( $wgActiveUserDays ) ) );
 
                // Occasionally merge in new updates
-               $seconds = self::mergeActiveUsers( 600 );
+               $seconds = min( self::mergeActiveUsers( 600 ), 
$wgActiveUserDays * 86400 );
                // Mention the level of staleness
                $out->addWikiMsg( 'cachedspecial-viewing-cached-ttl',
                        $this->getLanguage()->formatDuration( $seconds ) );
@@ -283,7 +283,12 @@
                if ( !wfReadOnly() ) {
                        if ( !$cTime || ( time() - wfTimestamp( TS_UNIX, $cTime 
) ) > $period ) {
                                $dbw = wfGetDB( DB_MASTER );
-                               self::doQueryCacheUpdate( $dbw, 2 * $period );
+                               if ( $dbw->estimateRowCount( 'recentchanges' ) 
<= 10000 ) {
+                                       $window = $wgActiveUserDays * 86400; // 
small wiki
+                               } else {
+                                       $window = $period * 2;
+                               }
+                               self::doQueryCacheUpdate( $dbw, $window );
                        }
                }
                return ( time() -

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I089b2f69d03bb289035be11ccfe4937931904d25
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: PleaseStand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to