X-Git-Url: https://git.heureux-cyclage.org/w/index.php?a=blobdiff_plain;f=includes%2Fdb%2Floadbalancer%2FLBFactorySimple.php;h=d8590b700318e70c20e561f6af1c7ea9a4be88f0;hb=56195efaa10e10d67d5f7e85029d64df52a0f7aa;hp=4632b0adc14182b937aa33eb713fb0807097a4d6;hpb=af21b2d6b4345b2cef3ae28a2ccad29105d7a553;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/loadbalancer/LBFactorySimple.php b/includes/db/loadbalancer/LBFactorySimple.php index 4632b0adc1..d8590b7003 100644 --- a/includes/db/loadbalancer/LBFactorySimple.php +++ b/includes/db/loadbalancer/LBFactorySimple.php @@ -95,7 +95,6 @@ class LBFactorySimple extends LBFactory { public function getMainLB( $wiki = false ) { if ( !isset( $this->mainLB ) ) { $this->mainLB = $this->newMainLB( $wiki ); - $this->mainLB->parentInfo( [ 'id' => 'main' ] ); $this->chronProt->initLB( $this->mainLB ); } @@ -111,7 +110,7 @@ class LBFactorySimple extends LBFactory { protected function newExternalLB( $cluster, $wiki = false ) { global $wgExternalServers; if ( !isset( $wgExternalServers[$cluster] ) ) { - throw new MWException( __METHOD__ . ": Unknown cluster \"$cluster\"" ); + throw new InvalidArgumentException( __METHOD__ . ": Unknown cluster \"$cluster\"" ); } return $this->newLoadBalancer( $wgExternalServers[$cluster] ); @@ -125,7 +124,6 @@ class LBFactorySimple extends LBFactory { public function getExternalLB( $cluster, $wiki = false ) { if ( !isset( $this->extLBs[$cluster] ) ) { $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $wiki ); - $this->extLBs[$cluster]->parentInfo( [ 'id' => "ext-$cluster" ] ); $this->chronProt->initLB( $this->extLBs[$cluster] ); } @@ -133,15 +131,13 @@ class LBFactorySimple extends LBFactory { } private function newLoadBalancer( array $servers ) { - $lb = new LoadBalancer( [ - 'servers' => $servers, - 'loadMonitor' => $this->loadMonitorClass, - 'readOnlyReason' => $this->readOnlyReason, - 'trxProfiler' => $this->trxProfiler, - 'srvCache' => $this->srvCache, - 'wanCache' => $this->wanCache - ] ); - + $lb = new LoadBalancer( array_merge( + $this->baseLoadBalancerParams(), + [ + 'servers' => $servers, + 'loadMonitor' => $this->loadMonitorClass, + ] + ) ); $this->initLoadBalancer( $lb ); return $lb;