X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fobjectcache%2FObjectCache.php;h=67d234601315346d52c8ab5c0bb3a17c6f5b3fc6;hb=1a21a63d52b9ebf940cd35f041d675d39c9d474a;hp=6d6d3459d9e4bc149db299be548b65ef97ea22ca;hpb=d18fa74c4dbc9d2597a36d04a3344cf1bb5a371c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 6d6d3459d9..67d2346013 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -332,6 +332,8 @@ class ObjectCache { * @throws UnexpectedValueException */ public static function newWANCacheFromParams( array $params ) { + global $wgCommandLineMode; + $services = MediaWikiServices::getInstance(); $erGroup = $services->getEventRelayerGroup(); @@ -340,12 +342,17 @@ class ObjectCache { $params['channels'][$action] = $channel; } $params['cache'] = self::newFromParams( $params['store'] ); - $params['stats'] = $services->getStatsdDataFactory(); if ( isset( $params['loggroup'] ) ) { $params['logger'] = LoggerFactory::getInstance( $params['loggroup'] ); } else { $params['logger'] = LoggerFactory::getInstance( 'objectcache' ); } + if ( !$wgCommandLineMode ) { + // Send the statsd data post-send on HTTP requests; avoid in CLI mode (T181385) + $params['stats'] = $services->getStatsdDataFactory(); + // Let pre-emptive refreshes happen post-send on HTTP requests + $params['asyncHandler'] = [ DeferredUpdates::class, 'addCallableUpdate' ]; + } $class = $params['class']; return new $class( $params );