X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=23a8bbbeba730f31f3f81db6cae5f9d6c7504f78;hb=60c718bc66740fc1a1ad9e5a5ad5abbf223001cb;hp=0287798959393b098cdd6ce2b354a2196bc3973f;hpb=d4cc4117d79648ab5f6d1d3f7dc84b043b073008;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0287798959..23a8bbbeba 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1346,9 +1346,14 @@ function wfReadOnlyReason() { } // Callers use this method to be aware that data presented to a user // may be very stale and thus allowing submissions can be problematic. - if ( $wgReadOnly === false && wfGetLB()->getLaggedSlaveMode() ) { + try { + if ( $wgReadOnly === false && wfGetLB()->getLaggedSlaveMode() ) { + $wgReadOnly = 'The database has been automatically locked ' . + 'while the slave database servers catch up to the master'; + } + } catch ( DBConnectionError $e ) { $wgReadOnly = 'The database has been automatically locked ' . - 'while the slave database servers catch up to the master'; + 'until the slave database servers become available'; } } @@ -3750,6 +3755,7 @@ function wfWaitForSlaves( } // Figure out which clusters need to be checked + /** @var LoadBalancer[] $lbs */ $lbs = array(); if ( $cluster === '*' ) { wfGetLBFactory()->forEachLB( function ( LoadBalancer $lb ) use ( &$lbs ) {