Introduce InterwikiLookupAdapter on top of SiteLookup
[lhc/web/wiklou.git] / includes / deferred / LinksDeletionUpdate.php
index ca3500e..4159166 100644 (file)
@@ -42,6 +42,8 @@ class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate {
         * @throws MWException
         */
        function __construct( WikiPage $page, $pageId = null, $timestamp = null ) {
+               parent::__construct();
+
                $this->page = $page;
                if ( $pageId ) {
                        $this->pageId = $pageId; // page ID at time of deletion
@@ -62,9 +64,12 @@ class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate {
 
                // Page may already be deleted, so don't just getId()
                $id = $this->pageId;
-               // Make sure all links update threads see the changes of each other.
-               // This handles the case when updates have to batched into several COMMITs.
-               $scopedLock = LinksUpdate::acquirePageLock( $this->getDB(), $id );
+
+               if ( $this->ticket ) {
+                       // Make sure all links update threads see the changes of each other.
+                       // This handles the case when updates have to batched into several COMMITs.
+                       $scopedLock = LinksUpdate::acquirePageLock( $this->getDB(), $id );
+               }
 
                $title = $this->page->getTitle();
                $dbw = $this->getDB(); // convenience
@@ -187,7 +192,7 @@ class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate {
                        }
                }
 
-               // Commit and release the lock
+               // Commit and release the lock (if set)
                ScopedCallback::consume( $scopedLock );
        }