Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/239161
Change subject: Avoid unneeded memcached queries in showPatrolFooter()
......................................................................
Avoid unneeded memcached queries in showPatrolFooter()
Change-Id: I395019e85cbc80df7d77183ccb75b3691949efc6
---
M includes/page/Article.php
1 file changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/61/239161/1
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 54db19c..eeb9062 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1091,16 +1091,17 @@
// to get the recentchanges row belonging to that entry
// (with rc_new = 1).
- // Check for cached results
- if ( $cache->get( wfMemcKey( 'NotPatrollablePage',
$this->getTitle()->getArticleID() ) ) ) {
- return false;
- }
-
if ( $this->mRevision
&& !RecentChange::isInRCLifespan(
$this->mRevision->getTimestamp(), 21600 )
) {
// The current revision is already older than what
could be in the RC table
// 6h tolerance because the RC might not be cleaned out
regularly
+ return false;
+ }
+
+ // Check for cached results
+ $key = wfMemcKey( 'NotPatrollablePage',
$this->getTitle()->getArticleID() );
+ if ( $cache->get( $key ) ) {
return false;
}
@@ -1134,7 +1135,7 @@
// Cache the information we gathered above in case we
can't patrol
// Don't cache in case we can patrol as this could
change
- $cache->set( wfMemcKey( 'NotPatrollablePage',
$this->getTitle()->getArticleID() ), '1' );
+ $cache->set( $key, '1' );
return false;
}
--
To view, visit https://gerrit.wikimedia.org/r/239161
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I395019e85cbc80df7d77183ccb75b3691949efc6
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