X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJobQueueFederated.php;h=0f8fcfbedb4f07489ddcbe3f87799943d337f8e4;hb=32fd2342e5648ec7d37eecb00fc4044a3a7526a9;hp=118b0f9525fa64de22559a58f2f68fc195729e29;hpb=74426f3cf796b149f1ae445e41815bbe148640b2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/JobQueueFederated.php b/includes/jobqueue/JobQueueFederated.php index 118b0f9525..0f8fcfbedb 100644 --- a/includes/jobqueue/JobQueueFederated.php +++ b/includes/jobqueue/JobQueueFederated.php @@ -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->wiki] ?? '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 ); @@ -187,7 +183,7 @@ class JobQueueFederated extends JobQueue { // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ( $i = $this->maxPartitionsTry; $i > 0 && count( $jobsLeft ); --$i ) { try { - $partitionRing->getLiveRing(); + $partitionRing->getLiveLocationWeights(); } catch ( UnexpectedValueException $e ) { break; // all servers down; nothing to insert to }