Made User::loadFromId() skip cache with READ_LATEST

* That flag is used for anti-dependencies and thus
  should never rely on cache

Bug: T95839
Change-Id: I4ffc8325e55588ef649b96e7b90bc95282f765a9
This commit is contained in:
Aaron Schulz 2015-09-30 13:39:54 -07:00 committed by Ori.livneh
parent 833cbddc99
commit 2c63d57ddd

View file

@ -385,10 +385,10 @@ class User implements IDBAccessObject {
return false;
}
// Try cache (unless this needs to lock the DB).
// Try cache (unless this needs data from the master DB).
// NOTE: if this thread called saveSettings(), the cache was cleared.
$locking = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING );
if ( $locking || !$this->loadFromCache() ) {
$latest = DBAccessObjectUtils::hasFlags( $flags, self::READ_LATEST );
if ( $latest || !$this->loadFromCache() ) {
wfDebug( "User: cache miss for user {$this->mId}\n" );
// Load from DB (make sure this thread sees its own changes)
if ( wfGetLB()->hasOrMadeRecentMasterChanges() ) {