X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJobQueueGroup.php;h=71d68d9f9336f2e6cbf730c1b9ab9663ee47cf58;hb=8b19d69c294ee20f4f1d0bf14583fd8377e38bae;hp=8d575625d93d931fe680c885eceefe5496f2b768;hpb=4e27dcee4cb975b35b2bf19df68ce69260339927;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/JobQueueGroup.php b/includes/jobqueue/JobQueueGroup.php index 8d575625d9..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; @@ -142,6 +144,20 @@ class JobQueueGroup { $this->cache->clear( 'queues-ready' ); } } + + $cache = ObjectCache::getLocalClusterInstance(); + $cache->set( + $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', self::TYPE_ANY ), + 'true', + 15 + ); + if ( array_diff( array_keys( $jobsByType ), $wgJobTypesExcludedFromDefaultQueue ) ) { + $cache->set( + $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', self::TYPE_DEFAULT ), + 'true', + 15 + ); + } } /** @@ -298,8 +314,8 @@ class JobQueueGroup { * @since 1.23 */ public function queuesHaveJobs( $type = self::TYPE_ANY ) { - $key = wfMemcKey( 'jobqueue', 'queueshavejobs', $type ); $cache = ObjectCache::getLocalClusterInstance(); + $key = $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', $type ); $value = $cache->get( $key ); if ( $value === false ) {