Generalize the LinkCache clear() call to JobRunner

The use for this logic is not specific to RefreshLinksJob

Change-Id: I4bb911ab5882d1795e12163df8ae6b227c58bc8a
This commit is contained in:
Aaron Schulz 2015-11-14 05:17:23 -08:00
parent 691a4fb0cf
commit d570d5102f
2 changed files with 3 additions and 4 deletions

View file

@ -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;

View file

@ -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 );