dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add LBFactory::disableChronologyProtection method
[lhc/web/wiklou.git]
/
includes
/
db
/
loadbalancer
/
LBFactorySimple.php
diff --git
a/includes/db/loadbalancer/LBFactorySimple.php
b/includes/db/loadbalancer/LBFactorySimple.php
index
e328727
..
1c9e094
100644
(file)
--- a/
includes/db/loadbalancer/LBFactorySimple.php
+++ b/
includes/db/loadbalancer/LBFactorySimple.php
@@
-29,8
+29,6
@@
class LBFactorySimple extends LBFactory {
private $mainLB;
/** @var LoadBalancer[] */
private $extLBs = array();
private $mainLB;
/** @var LoadBalancer[] */
private $extLBs = array();
- /** @var ChronologyProtector */
- private $chronProt;
/** @var string */
private $loadMonitorClass;
/** @var string */
private $loadMonitorClass;
@@
-38,7
+36,6
@@
class LBFactorySimple extends LBFactory {
public function __construct( array $conf ) {
parent::__construct( $conf );
public function __construct( array $conf ) {
parent::__construct( $conf );
- $this->chronProt = new ChronologyProtector;
$this->loadMonitorClass = isset( $conf['loadMonitorClass'] )
? $conf['loadMonitorClass']
: null;
$this->loadMonitorClass = isset( $conf['loadMonitorClass'] )
? $conf['loadMonitorClass']
: null;
@@
-89,7
+86,8
@@
class LBFactorySimple extends LBFactory {
return new LoadBalancer( array(
'servers' => $servers,
return new LoadBalancer( array(
'servers' => $servers,
- 'loadMonitor' => $this->loadMonitorClass
+ 'loadMonitor' => $this->loadMonitorClass,
+ 'readOnlyReason' => $this->readOnlyReason
) );
}
) );
}
@@
-121,7
+119,8
@@
class LBFactorySimple extends LBFactory {
return new LoadBalancer( array(
'servers' => $wgExternalServers[$cluster],
return new LoadBalancer( array(
'servers' => $wgExternalServers[$cluster],
- 'loadMonitor' => $this->loadMonitorClass
+ 'loadMonitor' => $this->loadMonitorClass,
+ 'readOnlyReason' => $this->readOnlyReason
) );
}
) );
}
@@
-157,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
}
}
}
}