Removed duplicated jobs in triggerOpportunisticLinksUpdate()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 6 May 2015 03:54:44 +0000 (20:54 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 6 May 2015 03:54:47 +0000 (20:54 -0700)
* They get deduplicated on final insertion, but de-duplication them
  on initial insertion (EnqueueJob) to avoid any build-up there.

Change-Id: Ia06f2bdf59a7e57fddb22890aa0b39420c0bfa7d

includes/jobqueue/JobSpecification.php
includes/page/WikiPage.php

index 327a18f..9ace1ba 100644 (file)
@@ -97,7 +97,7 @@ class JobSpecification implements IJobSpecification {
        /**
         * @param string $type
         * @param array $params Map of key/values
-        * @param array $opts Map of key/values
+        * @param array $opts Map of key/values; includes 'removeDuplicates'
         * @param Title $title Optional descriptive title
         */
        public function __construct(
index e938ca8..cc182a4 100644 (file)
@@ -3412,7 +3412,8 @@ class WikiPage implements Page, IDBAccessObject {
                // Check if the last link refresh was before page_touched
                if ( $this->getLinksTimestamp() < $this->getTouched() ) {
                        JobQueueGroup::singleton()->push( EnqueueJob::newFromLocalJobs(
-                               new JobSpecification( 'refreshLinks', $params, array(), $this->mTitle )
+                               new JobSpecification( 'refreshLinks', $params,
+                                       array( 'removeDuplicates' => true ), $this->mTitle )
                        ) );
                        return;
                }