X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FDeferredUpdates.php;h=716e65c8c39421acc563dec374ed2a78156443c2;hb=493fc3dfe34e9de701bfd4ab27ce8ebbddcbf71f;hp=00af97414305c78eebb2c2304801059599ee5db2;hpb=a86ae844e648c31ad7216738d4914802c0e60c07;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/DeferredUpdates.php b/includes/DeferredUpdates.php index 00af974143..716e65c8c3 100644 --- a/includes/DeferredUpdates.php +++ b/includes/DeferredUpdates.php @@ -88,10 +88,19 @@ class DeferredUpdates { } foreach ( $updates as $update ) { - $update->doUpdate(); + try { + $update->doUpdate(); - if ( $doCommit && $dbw->trxLevel() ) { - $dbw->commit( __METHOD__ ); + if ( $doCommit && $dbw->trxLevel() ) { + $dbw->commit( __METHOD__, 'flush' ); + } + } catch ( MWException $e ) { + // We don't want exceptions thrown during deferred updates to + // be reported to the user since the output is already sent. + // Instead we just log them. + if ( !$e instanceof ErrorPageError ) { + wfDebugLog( 'exception', $e->getLogMessage() ); + } } }