X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=6219476282405b6d7e4be7a3b9c2daad9421bd62;hb=8136216d631626875950e8b5c5a156a93b3779c3;hp=286bd8f1d6c3bd517a36da1d94618abaac7a4ee7;hpb=35f00337816ed66a7ca8bb6eeb5fccf422ee4e1a;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 286bd8f1d6..6219476282 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -26,7 +26,6 @@ require_once __DIR__ . '/../includes/PHPVersionCheck.php'; wfEntryPointCheck( 'cli' ); use MediaWiki\Shell\Shell; -use Wikimedia\Rdbms\DBReplicationWaitError; /** * @defgroup MaintenanceArchive Maintenance archives @@ -533,7 +532,7 @@ abstract class Maintenance { # Generic (non script dependant) options: $this->addOption( 'help', 'Display this help message', false, false, 'h' ); - $this->addOption( 'quiet', 'Whether to supress non-error output', false, false, 'q' ); + $this->addOption( 'quiet', 'Whether to suppress non-error output', false, false, 'q' ); $this->addOption( 'conf', 'Location of LocalSettings.php, if not default', false, true ); $this->addOption( 'wiki', 'For specifying the wiki ID', false, true ); $this->addOption( 'globals', 'Output globals at the end of processing for debugging' ); @@ -1393,17 +1392,12 @@ abstract class Maintenance { */ protected function commitTransaction( IDatabase $dbw, $fname ) { $dbw->commit( $fname ); - try { - $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); - $lbFactory->waitForReplication( - [ 'timeout' => 30, 'ifWritesSince' => $this->lastReplicationWait ] - ); - $this->lastReplicationWait = microtime( true ); - - return true; - } catch ( DBReplicationWaitError $e ) { - return false; - } + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $waitSucceeded = $lbFactory->waitForReplication( + [ 'timeout' => 30, 'ifWritesSince' => $this->lastReplicationWait ] + ); + $this->lastReplicationWait = microtime( true ); + return $waitSucceeded; } /** @@ -1675,7 +1669,6 @@ class FakeMaintenance extends Maintenance { protected $mSelf = "FakeMaintenanceScript"; public function execute() { - return; } }