X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Ffilerepo%2FLocalRepo.php;h=7b40a7ba819366f5888f045fb254ccb6a8bfadfb;hb=09110719680d7a0646a454ff1b2633a042952003;hp=82486993ada58aa06b15de9242c4a4305daa2429;hpb=2f885ee6b797e5a176ce7b270b674a04b5945b06;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index 82486993ad..7b40a7ba81 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -227,7 +227,7 @@ class LocalRepo extends FileRepo { ? Title::makeTitle( $row->rd_namespace, $row->rd_title )->getDBkey() : ''; // negative cache }, - [ 'pcTTL' => 30 ] + [ 'pcTTL' => WANObjectCache::TTL_PROC_LONG ] ); // @note: also checks " " for b/c @@ -453,11 +453,11 @@ class LocalRepo extends FileRepo { } /** - * Get a connection to the slave DB + * Get a connection to the replica DB * @return DatabaseBase */ function getSlaveDB() { - return wfGetDB( DB_SLAVE ); + return wfGetDB( DB_REPLICA ); } /** @@ -469,7 +469,7 @@ class LocalRepo extends FileRepo { } /** - * Get a callback to get a DB handle given an index (DB_SLAVE/DB_MASTER) + * Get a callback to get a DB handle given an index (DB_REPLICA/DB_MASTER) * @return Closure */ protected function getDBFactory() { @@ -500,9 +500,12 @@ class LocalRepo extends FileRepo { function invalidateImageRedirect( Title $title ) { $key = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) ); if ( $key ) { - $this->getMasterDB()->onTransactionPreCommitOrIdle( function() use ( $key ) { - ObjectCache::getMainWANInstance()->delete( $key ); - } ); + $this->getMasterDB()->onTransactionPreCommitOrIdle( + function () use ( $key ) { + ObjectCache::getMainWANInstance()->delete( $key ); + }, + __METHOD__ + ); } }