From: Aaron Schulz Date: Mon, 11 Apr 2016 20:29:46 +0000 (-0700) Subject: Increase triggerOpportunisticLinksUpdate() backoff TTL X-Git-Tag: 1.31.0-rc.0~7320 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=b543b9bf11afd49dc1db23f83b9446c121da0c05;p=lhc%2Fweb%2Fwiklou.git Increase triggerOpportunisticLinksUpdate() backoff TTL Make use of the expected TTL for the links to become possible stale, instead of the hard-coded value of 60 seconds. Use a minimum of 3600. Heavily used Commons templates, for example, lower the parser cache TTL to 86400. Enqueuing jobs before that time passes is a waste. Bug: T132318 Change-Id: I9a3c088db9dd1747b8e99ccf7ec4633e7f01fe7b --- diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 5e5532facf..75f083ee03 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3525,7 +3525,8 @@ class WikiPage implements Page, IDBAccessObject { // Although it would be de-duplicated, it would still waste I/O. $cache = ObjectCache::getLocalClusterInstance(); $key = $cache->makeKey( 'dynamic-linksupdate', 'last', $this->getId() ); - if ( $cache->add( $key, time(), 60 ) ) { + $ttl = max( $parserOutput->getCacheExpiry(), 3600 ); + if ( $cache->add( $key, time(), $ttl ) ) { JobQueueGroup::singleton()->lazyPush( RefreshLinksJob::newDynamic( $this->mTitle, $params ) );