Use DB domain in JobQueueGroup and make WikiMap domain ID methods stricter
[lhc/web/wiklou.git] / includes / jobqueue / aggregator / JobQueueAggregator.php
index 7ce2c74..27ad88e 100644 (file)
@@ -79,6 +79,9 @@ abstract class JobQueueAggregator {
 
        /**
         * @see JobQueueAggregator::notifyQueueEmpty()
+        * @param string $wiki
+        * @param string $type
+        * @return bool
         */
        abstract protected function doNotifyQueueEmpty( $wiki, $type );
 
@@ -97,6 +100,9 @@ abstract class JobQueueAggregator {
 
        /**
         * @see JobQueueAggregator::notifyQueueNonEmpty()
+        * @param string $wiki
+        * @param string $type
+        * @return bool
         */
        abstract protected function doNotifyQueueNonEmpty( $wiki, $type );
 
@@ -142,9 +148,9 @@ abstract class JobQueueAggregator {
                global $wgLocalDatabases;
 
                $pendingDBs = []; // (job type => (db list))
-               foreach ( $wgLocalDatabases as $db ) {
-                       foreach ( JobQueueGroup::singleton( $db )->getQueuesWithJobs() as $type ) {
-                               $pendingDBs[$type][] = $db;
+               foreach ( $wgLocalDatabases as $wikiId ) {
+                       foreach ( JobQueueGroup::singleton( $wikiId )->getQueuesWithJobs() as $type ) {
+                               $pendingDBs[$type][] = $wikiId;
                        }
                }
 
@@ -152,6 +158,9 @@ abstract class JobQueueAggregator {
        }
 }
 
+/**
+ * @ingroup JobQueue
+ */
 class JobQueueAggregatorNull extends JobQueueAggregator {
        protected function doNotifyQueueEmpty( $wiki, $type ) {
                return true;