From: RazeSoldier Date: Wed, 25 Sep 2019 14:54:13 +0000 (+0800) Subject: Make sure DBLoadBalancerFactory service is not disabled X-Git-Tag: 1.34.0~16 X-Git-Url: https://git.cyclocoop.org/?a=commitdiff_plain;h=9579fb0605dd490f55e7d2bec5216951ada6dde8;p=lhc%2Fweb%2Fwiklou.git Make sure DBLoadBalancerFactory service is not disabled After b873e929, when the CLI installation failed, the script will throw a ServiceDisabledException. This is because the installer disables DBLoadBalancerFactory service during instantiation and throws the exception because the installation failed to restore the service. So I check if the service is enabled before try commit the master changes. Bug: T229601 Change-Id: Ia7589d14ee55bcb03a64856b6dd2c81d8bda783c (cherry picked from commit eadde762b03ed94c687788ed3e0d9c65e5046fb2) --- diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index fe4905b228..863ce3bab1 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -118,7 +118,10 @@ try { // Potentially debug globals $maintenance->globals(); -if ( $maintenance->getDbType() !== Maintenance::DB_NONE ) { +if ( $maintenance->getDbType() !== Maintenance::DB_NONE && + // Service might be disabled, e.g. when running install.php + !MediaWikiServices::getInstance()->isServiceDisabled( 'DBLoadBalancerFactory' ) +) { // Perform deferred updates. $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $lbFactory->commitMasterChanges( $maintClass );