From b543b9bf11afd49dc1db23f83b9446c121da0c05 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 11 Apr 2016 13:29:46 -0700 Subject: [PATCH] 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 --- includes/page/WikiPage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ) ); -- 2.20.1