From 83e8d972fe640282bf828588c462bb5d52f6f506 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 16 Sep 2016 11:16:19 -0700 Subject: [PATCH] Avoid triggering SiteConfiguration lookup in JobQueueGroup::push() Just use $wgJobTypesExcludedFromDefaultQueue directly Bug: T145819 Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc --- includes/jobqueue/JobQueueGroup.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/jobqueue/JobQueueGroup.php b/includes/jobqueue/JobQueueGroup.php index de5f4103ec..71d68d9f93 100644 --- a/includes/jobqueue/JobQueueGroup.php +++ b/includes/jobqueue/JobQueueGroup.php @@ -120,6 +120,8 @@ class JobQueueGroup { * @return void */ public function push( $jobs ) { + global $wgJobTypesExcludedFromDefaultQueue; + $jobs = is_array( $jobs ) ? $jobs : [ $jobs ]; if ( !count( $jobs ) ) { return; @@ -149,7 +151,7 @@ class JobQueueGroup { 'true', 15 ); - if ( array_intersect( array_keys( $jobsByType ), $this->getDefaultQueueTypes() ) ) { + if ( array_diff( array_keys( $jobsByType ), $wgJobTypesExcludedFromDefaultQueue ) ) { $cache->set( $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', self::TYPE_DEFAULT ), 'true', -- 2.20.1