From 911d50b022587b966fadf8374b7bd739b7830732 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 5 Jun 2014 09:24:59 -0700 Subject: [PATCH] Also set the queue types map when rebuilding the ready queue map Change-Id: I0686859541661a22131c387d8fac6dc7b074c18c --- includes/jobqueue/aggregator/JobQueueAggregatorRedis.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php b/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php index 896aac4299..df9ae39e6a 100644 --- a/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php +++ b/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php @@ -118,16 +118,19 @@ class JobQueueAggregatorRedis extends JobQueueAggregator { $pendingDBs = $this->findPendingWikiQueues(); // (type => list of wikis) - $conn->delete( $this->getReadyQueueKey() . ":lock" ); // unlock - + $conn->multi( Redis::PIPELINE ); $now = time(); $map = array(); foreach ( $pendingDBs as $type => $wikis ) { + $conn->hSetNx( $this->getQueueTypesKey(), $type, 'enabled' ); foreach ( $wikis as $wiki ) { $map[$this->encQueueName( $type, $wiki )] = $now; } } $conn->hMSet( $this->getReadyQueueKey(), $map ); + $conn->exec(); + + $conn->delete( $this->getReadyQueueKey() . ":lock" ); // unlock } return $pendingDBs; @@ -145,6 +148,7 @@ class JobQueueAggregatorRedis extends JobQueueAggregator { } try { $conn->delete( $this->getReadyQueueKey() ); + // leave key at getQueueTypesKey() alone } catch ( RedisException $e ) { $this->handleException( $conn, $e ); -- 2.20.1