X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=includes%2Fdeferred%2FDeferredUpdates.php;h=3716971bca3c638260a75090ce45a03990dc6914;hb=f0c24143231d90ff409ddee62c853e8b6e1522bb;hp=d43ffbc97553a94576c176eb39f551caff9603e8;hpb=e48a0e5e35b4d5ace3da78c5c060173a835bde86;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index d43ffbc975..3716971bca 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -161,6 +161,7 @@ class DeferredUpdates { if ( isset( $queue[$class] ) ) { /** @var MergeableUpdate $existingUpdate */ $existingUpdate = $queue[$class]; + '@phan-var MergeableUpdate $existingUpdate'; $existingUpdate->merge( $update ); // Move the update to the end to handle things like mergeable purge // updates that might depend on the prior updates in the queue running @@ -362,11 +363,16 @@ class DeferredUpdates { $update->setTransactionTicket( $ticket ); } - $fnameTrxOwner = get_class( $update ) . '::doUpdate'; + // Designate $update::doUpdate() as the write round owner + $fnameTrxOwner = ( $update instanceof DeferrableCallback ) + ? $update->getOrigin() + : get_class( $update ) . '::doUpdate'; + // Determine whether the write round will be explicit or implicit $useExplicitTrxRound = !( $update instanceof TransactionRoundAwareUpdate && $update->getTransactionRoundRequirement() == $update::TRX_ROUND_ABSENT ); + // Flush any pending changes left over from an implicit transaction round if ( $useExplicitTrxRound ) { $lbFactory->beginMasterChanges( $fnameTrxOwner ); // new explicit round