From: Aaron Schulz Date: Thu, 14 Sep 2017 09:25:23 +0000 (+0200) Subject: De-duplicate HTMLCacheUpdate jobs with a page array of size 1 X-Git-Tag: 1.31.0-rc.0~2102^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=d0c373fdf2f28e9b541daa68e5b0e97666099dcf;p=lhc%2Fweb%2Fwiklou.git De-duplicate HTMLCacheUpdate jobs with a page array of size 1 BacklinkJobUtils consistently uses the "pages" field in leaf jobs, even when there is only one page per leaf job. RefreshLinksJob already has this logic for de-duplication. Change-Id: Ia189bbc9df44f2161cfed4192c23b2ac3cfa65ce --- diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php index 4c16d7f25b..0aa33cac18 100644 --- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php +++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php @@ -38,8 +38,15 @@ use MediaWiki\MediaWikiServices; class HTMLCacheUpdateJob extends Job { function __construct( Title $title, array $params ) { parent::__construct( 'htmlCacheUpdate', $title, $params ); - // Base backlink purge jobs can be de-duplicated - $this->removeDuplicates = ( !isset( $params['range'] ) && !isset( $params['pages'] ) ); + // Avoid the overhead of de-duplication when it would be pointless. + // Note that these jobs always set page_touched to the current time, + // so letting the older existing job "win" is still correct. + $this->removeDuplicates = ( + // Ranges rarely will line up + !isset( $params['range'] ) && + // Multiple pages per job make matches unlikely + !( isset( $params['pages'] ) && count( $params['pages'] ) != 1 ) + ); } /**