From: Matthias Mullie Date: Thu, 11 Apr 2013 13:22:40 +0000 (+0200) Subject: Add ChronologyProtector to ExternalLBs X-Git-Tag: 1.31.0-rc.0~20022^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=9af1ce8025a30f1fb2e91b095a32dc1c19642e1b;p=lhc%2Fweb%2Fwiklou.git Add ChronologyProtector to ExternalLBs Change-Id: Ic6c4e86b520f7899172e3ab43e81c4d1d9637d82 --- diff --git a/includes/db/LBFactory.php b/includes/db/LBFactory.php index 85e7775dbd..54b985987b 100644 --- a/includes/db/LBFactory.php +++ b/includes/db/LBFactory.php @@ -256,6 +256,7 @@ class LBFactory_Simple extends LBFactory { if ( !isset( $this->extLBs[$cluster] ) ) { $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $wiki ); $this->extLBs[$cluster]->parentInfo( array( 'id' => "ext-$cluster" ) ); + $this->chronProt->initLB( $this->extLBs[$cluster] ); } return $this->extLBs[$cluster]; } @@ -280,6 +281,9 @@ class LBFactory_Simple extends LBFactory { if ( $this->mainLB ) { $this->chronProt->shutdownLB( $this->mainLB ); } + foreach ( $this->extLBs as $extLB ) { + $this->chronProt->shutdownLB( $extLB ); + } $this->chronProt->shutdown(); $this->commitMasterChanges(); } diff --git a/includes/db/LBFactory_Multi.php b/includes/db/LBFactory_Multi.php index 2e4963d473..3043946a6a 100644 --- a/includes/db/LBFactory_Multi.php +++ b/includes/db/LBFactory_Multi.php @@ -145,8 +145,8 @@ class LBFactory_Multi extends LBFactory { $section = $this->getSectionForWiki( $wiki ); if ( !isset( $this->mainLBs[$section] ) ) { $lb = $this->newMainLB( $wiki, $section ); - $this->chronProt->initLB( $lb ); $lb->parentInfo( array( 'id' => "main-$section" ) ); + $this->chronProt->initLB( $lb ); $this->mainLBs[$section] = $lb; } return $this->mainLBs[$section]; @@ -181,6 +181,7 @@ class LBFactory_Multi extends LBFactory { if ( !isset( $this->extLBs[$cluster] ) ) { $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $wiki ); $this->extLBs[$cluster]->parentInfo( array( 'id' => "ext-$cluster" ) ); + $this->chronProt->initLB( $this->extLBs[$cluster] ); } return $this->extLBs[$cluster]; } @@ -296,6 +297,9 @@ class LBFactory_Multi extends LBFactory { foreach ( $this->mainLBs as $lb ) { $this->chronProt->shutdownLB( $lb ); } + foreach ( $this->extLBs as $extLB ) { + $this->chronProt->shutdownLB( $extLB ); + } $this->chronProt->shutdown(); $this->commitMasterChanges(); }