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

Change-Id: Ic06f64c22fc94665e58620a98e17264d48c97deb
This commit is contained in:
Aaron Schulz 2019-04-22 17:45:51 -07:00
parent 5ee6ec86b7
commit bc04dd93fe

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 ] );