From: Aaron Schulz Date: Fri, 12 Oct 2018 20:49:25 +0000 (-0700) Subject: Make DeferredUpdates enqueue updates that failed to run when possible X-Git-Tag: 1.34.0-rc.0~2487^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=0ef02cd018901d68f96130b073f01daf3c8c9bf5;p=lhc%2Fweb%2Fwiklou.git Make DeferredUpdates enqueue updates that failed to run when possible Bug: T206288 Bug: T206283 Change-Id: I6025bcc7d68cf214d291191d4044a66cdeff108b --- diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 67b5490511..a14b25c720 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -280,6 +280,16 @@ class DeferredUpdates { } MWExceptionHandler::rollbackMasterChangesAndLog( $e ); + // Try to push the update as a job so it can run later perhaps + if ( $mode !== 'enqueue' && $update instanceof EnqueueableDataUpdate ) { + try { + $spec = $update->getAsJobSpecification(); + JobQueueGroup::singleton( $spec['wiki'] )->push( $spec['job'] ); + } catch ( Exception $e ) { + MWExceptionHandler::rollbackMasterChangesAndLog( $e ); + } + } + // VW-style hack to work around T190178, so we can make sure // PageMetaDataUpdater doesn't throw exceptions. if ( defined( 'MW_PHPUNIT_TEST' ) ) {