From: Umherirrender Date: Sun, 30 Sep 2018 13:41:19 +0000 (+0200) Subject: Fix caller name in SiteStats::numberingroup/pagesInNs X-Git-Tag: 1.34.0-rc.0~3954 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=36f9f13a9e6178335d1068cd9c11ee4ed29c3703;hp=35cb46bcd7cd34ddb7099799ad318dbb6ee2c4e7;p=lhc%2Fweb%2Fwiklou.git Fix caller name in SiteStats::numberingroup/pagesInNs Seeing {closure} in the logs as caller is not helpful Change-Id: I0102cddc447257319fe8db7f8cbd837838653e99 --- diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 745c89166b..e3cb617e3f 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -149,11 +149,12 @@ class SiteStats { */ public static function numberingroup( $group ) { $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $fname = __METHOD__; return $cache->getWithSetCallback( $cache->makeKey( 'SiteStats', 'groupcounts', $group ), $cache::TTL_HOUR, - function ( $oldValue, &$ttl, array &$setOpts ) use ( $group ) { + function ( $oldValue, &$ttl, array &$setOpts ) use ( $group, $fname ) { $dbr = self::getLB()->getConnection( DB_REPLICA ); $setOpts += Database::getCacheSetOptions( $dbr ); @@ -164,7 +165,7 @@ class SiteStats { 'ug_group' => $group, 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ) ], - __METHOD__ + $fname ); }, [ 'pcTTL' => $cache::TTL_PROC_LONG ] @@ -199,11 +200,12 @@ class SiteStats { */ public static function pagesInNs( $ns ) { $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $fname = __METHOD__; return $cache->getWithSetCallback( $cache->makeKey( 'SiteStats', 'page-in-namespace', $ns ), $cache::TTL_HOUR, - function ( $oldValue, &$ttl, array &$setOpts ) use ( $ns ) { + function ( $oldValue, &$ttl, array &$setOpts ) use ( $ns, $fname ) { $dbr = self::getLB()->getConnection( DB_REPLICA ); $setOpts += Database::getCacheSetOptions( $dbr ); @@ -211,7 +213,7 @@ class SiteStats { 'page', 'COUNT(*)', [ 'page_namespace' => $ns ], - __METHOD__ + $fname ); }, [ 'pcTTL' => $cache::TTL_PROC_LONG ]