From: Aaron Schulz Date: Sun, 11 Sep 2016 11:57:12 +0000 (-0700) Subject: Make JobQueueGroup::push() update the queuesHaveJobs() cache X-Git-Tag: 1.31.0-rc.0~5639^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=6f9a246d25b29d406e68e366e707822f14be8a2d;p=lhc%2Fweb%2Fwiklou.git Make JobQueueGroup::push() update the queuesHaveJobs() cache This makes it so jobs can run sooner with $wgJobRunRate Bug: T145206 Change-Id: Ia7673f51312f90a696fa056bd3daf7f3f440782b --- diff --git a/includes/jobqueue/JobQueueGroup.php b/includes/jobqueue/JobQueueGroup.php index 8d575625d9..de5f4103ec 100644 --- a/includes/jobqueue/JobQueueGroup.php +++ b/includes/jobqueue/JobQueueGroup.php @@ -142,6 +142,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_intersect( array_keys( $jobsByType ), $this->getDefaultQueueTypes() ) ) { + $cache->set( + $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', self::TYPE_DEFAULT ), + 'true', + 15 + ); + } } /** @@ -298,8 +312,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 ) {