summaryrefslogtreecommitdiff
path: root/includes/revisiondelete/RevDelList.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/revisiondelete/RevDelList.php')
-rw-r--r--includes/revisiondelete/RevDelList.php24
1 files changed, 17 insertions, 7 deletions
diff --git a/includes/revisiondelete/RevDelList.php b/includes/revisiondelete/RevDelList.php
index c31c42b3..7ffb4279 100644
--- a/includes/revisiondelete/RevDelList.php
+++ b/includes/revisiondelete/RevDelList.php
@@ -97,7 +97,7 @@ abstract class RevDelList extends RevisionListBase {
* transactions are done here.
*
* @param array $params Associative array of parameters. Members are:
- * value: The integer value to set the visibility to
+ * value: ExtractBitParams() bitfield array
* comment: The log comment.
* perItemStatus: Set if you want per-item status reports
* @return Status
@@ -108,10 +108,13 @@ abstract class RevDelList extends RevisionListBase {
$comment = $params['comment'];
$perItemStatus = isset( $params['perItemStatus'] ) ? $params['perItemStatus'] : false;
- $this->res = false;
+ // CAS-style checks are done on the _deleted fields so the select
+ // does not need to use FOR UPDATE nor be in the atomic section
$dbw = wfGetDB( DB_MASTER );
- $this->doQuery( $dbw );
- $dbw->begin( __METHOD__ );
+ $this->res = $this->doQuery( $dbw );
+
+ $dbw->startAtomic( __METHOD__ );
+
$status = Status::newGood();
$missing = array_flip( $this->ids );
$this->clearFileOps();
@@ -125,6 +128,7 @@ abstract class RevDelList extends RevisionListBase {
// @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $this->reset(); $this->current(); $this->next() ) {
// @codingStandardsIgnoreEnd
+ /** @var $item RevDelItem */
$item = $this->current();
unset( $missing[$item->getId()] );
@@ -216,6 +220,7 @@ abstract class RevDelList extends RevisionListBase {
}
// Log it
+ // @FIXME: $newBits/$oldBits set in for loop, makes IDE warnings too
$this->updateLog( array(
'title' => $this->title,
'count' => $successCount,
@@ -226,10 +231,15 @@ abstract class RevDelList extends RevisionListBase {
'authorIds' => $authorIds,
'authorIPs' => $authorIPs
) );
- $dbw->commit( __METHOD__ );
// Clear caches
- $status->merge( $this->doPostCommitUpdates() );
+ $that = $this;
+ $dbw->onTransactionIdle( function() use ( $that ) {
+ $that->doPostCommitUpdates();
+ } );
+
+ $dbw->endAtomic( __METHOD__ );
+
return $status;
}
@@ -260,7 +270,7 @@ abstract class RevDelList extends RevisionListBase {
if ( !$field ) {
throw new MWException( "Bad log URL param type!" );
}
- // Put things hidden from sysops in the oversight log
+ // Put things hidden from sysops in the suppression log
if ( ( $params['newBits'] | $params['oldBits'] ) & $this->getSuppressBit() ) {
$logType = 'suppress';
} else {