Do SearchUpdate::indexTitle after search-update is supported check
[lhc/web/wiklou.git] / includes / deferred / LinksUpdate.php
index dbfdab0..c253e74 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() {
@@ -944,8 +948,7 @@ class LinksUpdate extends SqlDataUpdate implements EnqueueableDataUpdate {
                                        $inv = array( $inv );
                                }
                                foreach ( $inv as $table ) {
-                                       $update = new HTMLCacheUpdate( $this->mTitle, $table );
-                                       $update->doUpdate();
+                                       DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this->mTitle, $table ) );
                                }
                        }
                }