Made JobQueueAggregatorRedis make sure the wiki set key is up-to-date
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 2 May 2015 20:07:55 +0000 (13:07 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 2 May 2015 20:07:55 +0000 (13:07 -0700)
Change-Id: I84ccfd990fada80ee3005b746d33ed4473abb6d8

includes/jobqueue/aggregator/JobQueueAggregatorRedis.php

index 847dd6f..6c49646 100644 (file)
@@ -77,6 +77,7 @@ class JobQueueAggregatorRedis extends JobQueueAggregator {
                try {
                        $conn->multi( Redis::PIPELINE );
                        $conn->hSetNx( $this->getQueueTypesKey(), $type, 'enabled' );
+                       $conn->sAdd( $this->getWikiSetKey(), $wiki );
                        $conn->hSet( $this->getReadyQueueKey(), $this->encQueueName( $type, $wiki ), time() );
                        $conn->exec();
 
@@ -197,6 +198,13 @@ class JobQueueAggregatorRedis extends JobQueueAggregator {
                return "jobqueue:aggregator:h-queue-types:v2"; // global
        }
 
+       /**
+        * @return string
+        */
+       private function getWikiSetKey() {
+               return "jobqueue:aggregator:s-wikis:v2"; // global
+       }
+
        /**
         * @param string $type
         * @param string $wiki