From c6ea60543b7b5a2cfca9a6a9bf99f5dfc2f45435 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 5 May 2015 20:54:44 -0700 Subject: [PATCH] Removed duplicated jobs in triggerOpportunisticLinksUpdate() * 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 | 2 +- includes/page/WikiPage.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/jobqueue/JobSpecification.php b/includes/jobqueue/JobSpecification.php index 327a18f95a..9ace1ba54e 100644 --- a/includes/jobqueue/JobSpecification.php +++ b/includes/jobqueue/JobSpecification.php @@ -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( diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index e938ca84bc..cc182a4258 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -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; } -- 2.20.1