jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/349144 )
Change subject: Fix bogus field reference in Category::getCountMessage()
callback
..
Fix bogus field reference in Category::getCountMessage() callback
Follows-up 922e68f739f143. (T162121)
Bug: T162941
Change-Id: I40623203e97f7155c2af171a37b1128a59415315
---
M includes/Category.php
M includes/CategoryViewer.php
2 files changed, 8 insertions(+), 10 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Category.php b/includes/Category.php
index ece32ea..50ffeec 100644
--- a/includes/Category.php
+++ b/includes/Category.php
@@ -321,6 +321,13 @@
}
$dbw = wfGetDB( DB_MASTER );
+ # Avoid excess contention on the same category (T162121)
+ $name = __METHOD__ . ':' . md5( $this->mName );
+ $scopedLock = $dbw->getScopedLockAndFlush( $name, __METHOD__, 1
);
+ if ( !$scopedLock ) {
+ return;
+ }
+
$dbw->startAtomic( __METHOD__ );
$cond1 = $dbw->conditional( [ 'page_namespace' => NS_CATEGORY
], 1, 'NULL' );
diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index 0205d70..7086a48 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -740,16 +740,7 @@
// to refresh the incorrect category table entry --
which should be
// quick due to the small number of entries.
$totalcnt = $rescnt;
- $category = $this->cat;
- DeferredUpdates::addCallableUpdate( function () use (
$category ) {
- # Avoid excess contention on the same category
(T162121)
- $dbw = wfGetDB( DB_MASTER );
- $name = __METHOD__ . ':' . md5( $this->mName );
- $scopedLock = $dbw->getScopedLockAndFlush(
$name, __METHOD__, 1 );
- if ( $scopedLock ) {
- $category->refreshCounts();
- }
- } );
+ DeferredUpdates::addCallableUpdate( [ $this->cat,
'refreshCounts' ] );
} else {
// Case 3: hopeless. Don't give a total count at all.
// Messages: category-subcat-count-limited,
category-article-count-limited,
--
To view, visit https://gerrit.wikimedia.org/r/349144
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I40623203e97f7155c2af171a37b1128a59415315
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz
Gerrit-Reviewer: Krinkle
Gerrit-Reviewer: jenkins-bot <>
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits