wiki.techinc.nl/includes/deferred/TransactionRoundAwareUpdate.php
Aaron Schulz 1f4efc6c34 Add RefreshSecondaryDataUpdate and use it in DerivedPageDataUpdater
This class implements EnqueueableDataUpdate and can be pushed as a
job if it fails to run via DeferredUpdates.

Unlike a1f7fd3ada, make RefreshSecondaryDataUpdate skip failing
updates in doUpdate(). Instead of throwing the first exception from
any update, log any exceptions that occur and try all the other
updates. The first error will be re-thrown afterwards.

Also, make sure that each DataUpdate still has outer transaction
scope. This property is documented at mediawiki.org and should not
be changed.

Add integration tests for RefreshSecondaryDataUpdateTest.

Bug: T218456
Bug: T206283
Change-Id: I7c6554a4d4cd76dfe7cd2967afe30b3aa1069fcb
2020-03-11 00:42:48 -07:00

19 lines
561 B
PHP

<?php
/**
* Deferrable update that specifies whether it must run outside of any explicit
* LBFactory transaction round or must run inside of a round owned by doUpdate().
*
* @since 1.34
*/
interface TransactionRoundAwareUpdate {
/** @var int No explicit transaction round should be used */
const TRX_ROUND_ABSENT = 1;
/** @var int An explicit transaction round owned by self::doUpdate should be used */
const TRX_ROUND_PRESENT = 2;
/**
* @return int One of the class TRX_ROUND_* constants
*/
public function getTransactionRoundRequirement();
}