dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "SiteStats::jobs fix when there is a single job"
[lhc/web/wiklou.git]
/
includes
/
SiteStats.php
diff --git
a/includes/SiteStats.php
b/includes/SiteStats.php
index
ac5e49e
..
df3e305
100644
(file)
--- a/
includes/SiteStats.php
+++ b/
includes/SiteStats.php
@@
-189,12
+189,11
@@
class SiteStats {
* @return int
*/
static function numberingroup( $group ) {
* @return int
*/
static function numberingroup( $group ) {
- $cache =
ObjectCache::getMainWANInstanc
e();
+ $cache =
MediaWikiServices::getInstance()->getMainWANObjectCach
e();
return $cache->getWithSetCallback(
return $cache->getWithSetCallback(
-
wfMemc
Key( 'SiteStats', 'groupcounts', $group ),
+
$cache->make
Key( 'SiteStats', 'groupcounts', $group ),
$cache::TTL_HOUR,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $group ) {
$cache::TTL_HOUR,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $group ) {
- global $wgDisableUserGroupExpiry;
$dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr );
$dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr );
@@
-204,9
+203,7
@@
class SiteStats {
'COUNT(*)',
[
'ug_group' => $group,
'COUNT(*)',
[
'ug_group' => $group,
- $wgDisableUserGroupExpiry ?
- '1' :
- 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
],
__METHOD__
);
],
__METHOD__
);
@@
-225,13
+222,6
@@
class SiteStats {
} catch ( JobQueueError $e ) {
self::$jobs = 0;
}
} catch ( JobQueueError $e ) {
self::$jobs = 0;
}
- /**
- * Zero rows still do single row read for row that doesn't exist,
- * but people are annoyed by that
- */
- if ( self::$jobs == 1 ) {
- self::$jobs = 0;
- }
}
return self::$jobs;
}
}
return self::$jobs;
}
@@
-299,7
+289,6
@@
class SiteStatsInit {
private $mUsers = null, $mFiles = null;
/**
private $mUsers = null, $mFiles = null;
/**
- * Constructor
* @param bool|IDatabase $database
* - boolean: Whether to use the master DB
* - IDatabase: Database connection to use
* @param bool|IDatabase $database
* - boolean: Whether to use the master DB
* - IDatabase: Database connection to use