Increase triggerOpportunisticLinksUpdate() backoff TTL
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 11 Apr 2016 20:29:46 +0000 (13:29 -0700)
committerOri.livneh <ori@wikimedia.org>
Mon, 11 Apr 2016 21:58:47 +0000 (21:58 +0000)
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

index 5e5532f..75f083e 100644 (file)
@@ -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 )
                                        );