Switched RevDelList to using start/endAtomic()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 9 Apr 2015 18:05:07 +0000 (11:05 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 9 Apr 2015 18:17:03 +0000 (11:17 -0700)
Change-Id: I2c950b558390e3fd9917414998f576e4e3b0593d

includes/revisiondelete/RevDelList.php

index 840fd77..f16fd15 100644 (file)
@@ -92,7 +92,7 @@ abstract class RevDelList extends RevisionListBase {
                $this->res = false;
                $dbw = wfGetDB( DB_MASTER );
                $this->doQuery( $dbw );
-               $dbw->begin( __METHOD__ );
+               $dbw->startAtomic( __METHOD__ );
                $status = Status::newGood();
                $missing = array_flip( $this->ids );
                $this->clearFileOps();
@@ -207,10 +207,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;
        }