Merge "Avoid sending stashing statsd data for bots in AbuseFilter::filterAction"

This commit is contained in:
jenkins-bot 2019-04-23 14:08:38 +00:00 committed by Gerrit Code Review
commit cf491b18f7

View file

@ -1152,7 +1152,10 @@ class AbuseFilter {
global $wgAbuseFilterLogIP;
$logger = LoggerFactory::getInstance( 'StashEdit' );
$statsd = MediaWikiServices::getInstance()->getStatsdDataFactory();
// Bots do not use edit stashing, so avoid distorting the stats
$statsd = $user->isBot()
? new NullStatsdDataFactory()
: MediaWikiServices::getInstance()->getStatsdDataFactory();
// Add vars from extensions
Hooks::run( 'AbuseFilter-filterAction', [ &$vars, $title ] );