Make triggerOpportunisticLinksUpdate() directly use RefreshLinks
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 20 Oct 2015 20:51:59 +0000 (13:51 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 20 Oct 2015 20:55:51 +0000 (20:55 +0000)
This makes the jobs *actually* end up in the
'refreshLinksPrioritized' queue rather than 'refreshLinks'.
These jobs can run fast in a higher priority queue since the
output is already cached (much of the point of 'prioritize').
They won't if they get stuck behind regular 'refreshLinks'.

This also avoids the indirection of an intermediate job.
The use of lazyPush() is already enough to prevent the user
from experiencing cross-DC RTT overhead.

Change-Id: I5d0440588db09c299cd70191e5624ffc7ebf04c0

includes/page/WikiPage.php

index 29038c7..8acb3e3 100644 (file)
@@ -3489,11 +3489,7 @@ class WikiPage implements Page, IDBAccessObject {
                if ( $this->getLinksTimestamp() < $this->getTouched() ) {
                        $params['isOpportunistic'] = true;
                        $params['rootJobTimestamp'] = $parserOutput->getCacheTime();
-
-                       JobQueueGroup::singleton()->lazyPush( EnqueueJob::newFromLocalJobs(
-                               new JobSpecification( 'refreshLinks', $params,
-                                       array( 'removeDuplicates' => true ), $this->mTitle )
-                       ) );
+                       JobQueueGroup::singleton()->lazyPush( new RefreshLinksJob( $this->mTitle, $params ) );
                }
        }