From d570d5102fbfaf062149e93065721a1e517c5cef Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 14 Nov 2015 05:17:23 -0800 Subject: [PATCH] Generalize the LinkCache clear() call to JobRunner The use for this logic is not specific to RefreshLinksJob Change-Id: I4bb911ab5882d1795e12163df8ae6b227c58bc8a --- includes/jobqueue/JobRunner.php | 3 +++ includes/jobqueue/jobs/RefreshLinksJob.php | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index 318330e086..dd2ef8fd3a 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -191,7 +191,10 @@ class JobRunner implements LoggerAwareInterface { } // Commit all outstanding connections that are in a transaction // to get a fresh repeatable read snapshot on every connection. + // Note that jobs are still responsible for handling slave lag. wfGetLBFactory()->commitAll(); + // Clear out title cache data from prior snapshots + LinkCache::singleton()->clear(); $timeMs = intval( ( microtime( true ) - $jobStartTime ) * 1000 ); $timeMsTotal += $timeMs; diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 5f1a1a6bed..c42a4c64d9 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -139,10 +139,6 @@ class RefreshLinksJob extends Job { wfGetLB()->waitFor( $this->params['masterPos'] ); } - // Clear out title cache data from prior job transaction snapshots - $linkCache = LinkCache::singleton(); - $linkCache->clear(); - // Fetch the current page and revision... $page = WikiPage::factory( $title ); $revision = Revision::newFromTitle( $title, false, Revision::READ_NORMAL ); -- 2.20.1