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
// 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 )
);