Merge "Reduce updateLinksTimestamp() DB contention"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 17 Nov 2015 02:53:03 +0000 (02:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 17 Nov 2015 02:53:03 +0000 (02:53 +0000)
includes/deferred/LinksUpdate.php

index dbfdab0..a6290ed 100644 (file)
@@ -145,7 +145,11 @@ class LinksUpdate extends SqlDataUpdate implements EnqueueableDataUpdate {
        public function doUpdate() {
                Hooks::run( 'LinksUpdate', array( &$this ) );
                $this->doIncrementalUpdate();
-               Hooks::run( 'LinksUpdateComplete', array( &$this ) );
+
+               $that = $this;
+               $this->mDb->onTransactionIdle( function() use ( $that ) {
+                       Hooks::run( 'LinksUpdateComplete', array( &$that ) );
+               } );
        }
 
        protected function doIncrementalUpdate() {