Only send statsd data for WAN cache in non-CLI mode
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 2 Dec 2017 20:34:22 +0000 (12:34 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 2 Dec 2017 20:34:22 +0000 (12:34 -0800)
Bug: T181385
Change-Id: Ic51a084206cea93621393359ded4ff77beef5f13

includes/objectcache/ObjectCache.php

index 07432c0..67d2346 100644 (file)
@@ -342,14 +342,15 @@ 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' );
                }
-               // Let pre-emptive refreshes happen post-send on HTTP requests
                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'];