Merge "Allow partially blocked users to tag unrelated revisions"
[lhc/web/wiklou.git] / includes / jobqueue / jobs / RefreshLinksJob.php
index 3179a2f..33b05b8 100644 (file)
@@ -156,7 +156,9 @@ class RefreshLinksJob extends Job {
                // Serialize link update job by page ID so they see each others' changes.
                // The page ID and latest revision ID will be queried again after the lock
                // is acquired to bail if they are changed from that of loadPageData() above.
-               $dbw = $lbFactory->getMainLB()->getConnection( DB_MASTER );
+               // Serialize links updates by page ID so they see each others' changes
+               $dbw = $lbFactory->getMainLB()->getConnectionRef( DB_MASTER );
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scopedLock = LinksUpdate::acquirePageLock( $dbw, $page->getId(), 'job' );
                if ( $scopedLock === null ) {
                        // Another job is already updating the page, likely for a prior revision (T170596)
@@ -274,8 +276,8 @@ class RefreshLinksJob extends Job {
                $title = $page->getTitle();
                // Get the latest ID since acquirePageLock() in runForTitle() flushed the transaction.
                // This is used to detect edits/moves after loadPageData() but before the scope lock.
-               // The works around the chicken/egg problem of determining the scope lock key name.
-               $latest = $title->getLatestRevID( Title::GAID_FOR_UPDATE );
+               // The works around the chicken/egg problem of determining the scope lock key name
+               $latest = $title->getLatestRevID( Title::READ_LATEST );
 
                $triggeringRevisionId = $this->params['triggeringRevisionId'] ?? null;
                if ( $triggeringRevisionId && $triggeringRevisionId !== $latest ) {