Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/248817
Change subject: Convert ForeignApiRepo::httpGetCached() to the WAN cache
......................................................................
Convert ForeignApiRepo::httpGetCached() to the WAN cache
Change-Id: I4f1098a6e98570fc4fea6941ffcd64540d6caebd
---
M includes/filerepo/ForeignAPIRepo.php
1 file changed, 8 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/17/248817/1
diff --git a/includes/filerepo/ForeignAPIRepo.php
b/includes/filerepo/ForeignAPIRepo.php
index 4ffbf4a..38305dc 100644
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -552,19 +552,16 @@
}
if ( !isset( $this->mQueryCache[$url] ) ) {
- global $wgMemc;
-
- $key = $this->getLocalCacheKey( get_class( $this ),
$target, md5( $url ) );
- $data = $wgMemc->get( $key );
+ $data =
ObjectCache::getMainWANInstance()->getWithSetCallback(
+ $this->getLocalCacheKey( get_class( $this ),
$target, md5( $url ) ),
+ $cacheTTL,
+ function () use ( $url ) {
+ return ForeignAPIRepo::httpGet( $url );
+ }
+ );
if ( !$data ) {
- $data = self::httpGet( $url );
-
- if ( !$data ) {
- return null;
- }
-
- $wgMemc->set( $key, $data, $cacheTTL );
+ return null;
}
if ( count( $this->mQueryCache ) > 100 ) {
--
To view, visit https://gerrit.wikimedia.org/r/248817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f1098a6e98570fc4fea6941ffcd64540d6caebd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits