Add LBFactory::disableChronologyProtection method
[lhc/web/wiklou.git] / includes / db / loadbalancer / LBFactorySimple.php
index 353c47a..1c9e094 100644 (file)
@@ -29,8 +29,6 @@ class LBFactorySimple extends LBFactory {
        private $mainLB;
        /** @var LoadBalancer[] */
        private $extLBs = array();
-       /** @var ChronologyProtector */
-       private $chronProt;
 
        /** @var string */
        private $loadMonitorClass;
@@ -38,7 +36,6 @@ class LBFactorySimple extends LBFactory {
        public function __construct( array $conf ) {
                parent::__construct( $conf );
 
-               $this->chronProt = new ChronologyProtector;
                $this->loadMonitorClass = isset( $conf['loadMonitorClass'] )
                        ? $conf['loadMonitorClass']
                        : null;
@@ -159,14 +156,10 @@ class LBFactorySimple extends LBFactory {
                }
        }
 
-       public function shutdown() {
-               if ( $this->mainLB ) {
-                       $this->chronProt->shutdownLB( $this->mainLB );
+       public function shutdown( $flags = 0 ) {
+               if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) {
+                       $this->shutdownChronologyProtector( $this->chronProt );
                }
-               foreach ( $this->extLBs as $extLB ) {
-                       $this->chronProt->shutdownLB( $extLB );
-               }
-               $this->chronProt->shutdown();
-               $this->commitMasterChanges();
+               $this->commitMasterChanges(); // sanity
        }
 }