Add ChronologyProtector to ExternalLBs
authorMatthias Mullie <git@mullie.eu>
Thu, 11 Apr 2013 13:22:40 +0000 (15:22 +0200)
committerMatthias Mullie <git@mullie.eu>
Thu, 11 Apr 2013 13:24:05 +0000 (15:24 +0200)
Change-Id: Ic6c4e86b520f7899172e3ab43e81c4d1d9637d82

includes/db/LBFactory.php
includes/db/LBFactory_Multi.php

index 85e7775..54b9859 100644 (file)
@@ -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();
        }
index 2e4963d..3043946 100644 (file)
@@ -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();
        }