Use DB domain in JobQueueGroup and make WikiMap domain ID methods stricter
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueFederated.php
index 7f3b2b1..26886b7 100644 (file)
@@ -73,15 +73,11 @@ class JobQueueFederated extends JobQueue {
         */
        protected function __construct( array $params ) {
                parent::__construct( $params );
-               $section = isset( $params['sectionsByWiki'][$this->wiki] )
-                       ? $params['sectionsByWiki'][$this->wiki]
-                       : 'default';
+               $section = $params['sectionsByWiki'][$this->domain] ?? 'default';
                if ( !isset( $params['partitionsBySection'][$section] ) ) {
                        throw new MWException( "No configuration for section '$section'." );
                }
-               $this->maxPartitionsTry = isset( $params['maxPartitionsTry'] )
-                       ? $params['maxPartitionsTry']
-                       : 2;
+               $this->maxPartitionsTry = $params['maxPartitionsTry'] ?? 2;
                // Get the full partition map
                $partitionMap = $params['partitionsBySection'][$section];
                arsort( $partitionMap, SORT_NUMERIC );
@@ -423,7 +419,7 @@ class JobQueueFederated extends JobQueue {
        }
 
        public function getCoalesceLocationInternal() {
-               return "JobQueueFederated:wiki:{$this->wiki}" .
+               return "JobQueueFederated:wiki:{$this->domain}" .
                        sha1( serialize( array_keys( $this->partitionQueues ) ) );
        }