jenkins-bot has submitted this change and it was merged.
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, 8 insertions(+), 7 deletions(-)
Approvals:
Hoo man: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 120aa5c..29a38ba 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;
}
@@ -1129,7 +1130,7 @@
} else {
// 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' );
}
if ( !$rc ) {
@@ -1144,7 +1145,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: merged
Gerrit-Change-Id: I395019e85cbc80df7d77183ccb75b3691949efc6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits