From: Aaron Schulz Date: Sun, 18 Mar 2018 04:22:56 +0000 (-0700) Subject: Set visiblity of some HashRing methods X-Git-Tag: 1.31.0-rc.0~354^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=45a6a7ad6771ed4c94f7a9c568ffeeca4935ca87 Set visiblity of some HashRing methods * getLiveRing() is now protected * getLocation() is now final Change-Id: I16002fe7187d8bbb6e36d4dd9a1302ee1d46a4bb --- diff --git a/includes/jobqueue/JobQueueFederated.php b/includes/jobqueue/JobQueueFederated.php index 118b0f9525..7f3b2b1d59 100644 --- a/includes/jobqueue/JobQueueFederated.php +++ b/includes/jobqueue/JobQueueFederated.php @@ -187,7 +187,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 } diff --git a/includes/libs/HashRing.php b/includes/libs/HashRing.php index 21558f77b6..66121303bc 100644 --- a/includes/libs/HashRing.php +++ b/includes/libs/HashRing.php @@ -83,7 +83,7 @@ class HashRing { * @param string $item * @return string Location */ - public function getLocation( $item ) { + final public function getLocation( $item ) { $locations = $this->getLocations( $item, 1 ); return $locations[0]; @@ -174,7 +174,7 @@ class HashRing { * @return HashRing * @throws UnexpectedValueException */ - public function getLiveRing() { + protected function getLiveRing() { $now = time(); if ( $this->liveRing === null || $this->ejectionNextExpiry <= $now ) { $this->ejectionExpiries = array_filter(