From: Aaron Schulz Date: Thu, 19 Oct 2017 19:39:56 +0000 (-0700) Subject: Set getDeduplicationInfo() for HTMLCacheUpdateJob X-Git-Tag: 1.31.0-rc.0~1709^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=2cb965c5a5393a168fe71561e5dfe8d2bb9fce98;p=lhc%2Fweb%2Fwiklou.git Set getDeduplicationInfo() for HTMLCacheUpdateJob This allows de-duplication of single page jobs for the same page due to edits to different templates. This is the same logic that RefreshLinksJob already has. Also fix a bug in that method in RefreshLinksJob. Change-Id: I2f79031c945eb3d195f9dbda949077bbc3e67918 --- diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php index e8edab59b4..4d75cb303c 100644 --- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php +++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php @@ -169,6 +169,20 @@ class HTMLCacheUpdateJob extends Job { } } + public function getDeduplicationInfo() { + $info = parent::getDeduplicationInfo(); + if ( is_array( $info['params'] ) ) { + // For per-pages jobs, the job title is that of the template that changed + // (or similar), so remove that since it ruins duplicate detection + if ( isset( $info['params']['pages'] ) ) { + unset( $info['namespace'] ); + unset( $info['title'] ); + } + } + + return $info; + } + public function workItemCount() { if ( !empty( $this->params['recursive'] ) ) { return 0; // nothing actually purged diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 424fcecb2d..51e964d54f 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -291,7 +291,7 @@ class RefreshLinksJob extends Job { if ( is_array( $info['params'] ) ) { // For per-pages jobs, the job title is that of the template that changed // (or similar), so remove that since it ruins duplicate detection - if ( isset( $info['pages'] ) ) { + if ( isset( $info['params']['pages'] ) ) { unset( $info['namespace'] ); unset( $info['title'] ); }