mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-11 16:28:21 +00:00
Move actions limit to a global variable
This opens the door to further customization and allows every wiki to set its own value. Bug: T132925 Change-Id: I63985f2809c3253b07b33caef30fcd8d4c62dfd4
This commit is contained in:
parent
e4fa51e209
commit
55cac6f1b0
|
@ -332,6 +332,10 @@
|
|||
"value": 500,
|
||||
"description": "Runtime in milliseconds before a filter is considered slow."
|
||||
},
|
||||
"AbuseFilterProfileActionsCap": {
|
||||
"value": 10000,
|
||||
"description": "Number of action that determines when to reset profiling stats."
|
||||
},
|
||||
"AbuseFilterRangeBlockSize" : {
|
||||
"value": {
|
||||
"IPv4": 16,
|
||||
|
|
|
@ -1844,7 +1844,7 @@ class AbuseFilter {
|
|||
* @param string $group The filter's group (as defined in $wgAbuseFilterValidGroups)
|
||||
*/
|
||||
public static function recordStats( $filters, $group = 'default' ) {
|
||||
global $wgAbuseFilterConditionLimit;
|
||||
global $wgAbuseFilterConditionLimit, $wgAbuseFilterProfileActionsCap;
|
||||
|
||||
$stash = ObjectCache::getMainStashInstance();
|
||||
|
||||
|
@ -1859,7 +1859,7 @@ class AbuseFilter {
|
|||
|
||||
$storage_period = self::$statsStoragePeriod;
|
||||
|
||||
if ( !$total || $total > 10000 ) {
|
||||
if ( !$total || $total > $wgAbuseFilterProfileActionsCap ) {
|
||||
// This is for if the total doesn't exist, or has gone past 10,000.
|
||||
// Recreate all the keys at the same time, so they expire together.
|
||||
$stash->set( $total_key, 0, $storage_period );
|
||||
|
|
Loading…
Reference in a new issue