jenkins-bot has submitted this change and it was merged.

Change subject: Avoid triggering SiteConfiguration lookup in 
JobQueueGroup::push()
......................................................................


Avoid triggering SiteConfiguration lookup in JobQueueGroup::push()

Just use $wgJobTypesExcludedFromDefaultQueue directly

Bug: T145819
Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index de5f410..71d68d9 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -120,6 +120,8 @@
         * @return void
         */
        public function push( $jobs ) {
+               global $wgJobTypesExcludedFromDefaultQueue;
+
                $jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
                if ( !count( $jobs ) ) {
                        return;
@@ -149,7 +151,7 @@
                        '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',

-- 
To view, visit https://gerrit.wikimedia.org/r/311168
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to