mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
add threshold for jerk blocker for reducing change of false positive for more followed sites
This commit is contained in:
parent
9382505a29
commit
19dadfd6d2
1 changed files with 3 additions and 1 deletions
|
@ -141,6 +141,7 @@ class Site < Sequel::Model
|
|||
DISPOSABLE_EMAIL_BLACKLIST_PATH = File.join(DIR_ROOT, 'files', 'disposable_email_blacklist.conf')
|
||||
BANNED_EMAIL_BLACKLIST_PATH = File.join(DIR_ROOT, 'files', 'banned_email_blacklist.conf')
|
||||
|
||||
BLOCK_JERK_PERCENTAGE = 30
|
||||
BLOCK_JERK_THRESHOLD = 25
|
||||
MAXIMUM_TAGS = 5
|
||||
MAX_USERNAME_LENGTH = 32.freeze
|
||||
|
@ -621,7 +622,8 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
def is_a_jerk?
|
||||
blocks_dataset.count >= BLOCK_JERK_THRESHOLD
|
||||
blocks_dataset_count = blocks_dataset.count
|
||||
blocks_dataset_count >= BLOCK_JERK_THRESHOLD && ((blocks_dataset_count / follows_dataset.count.to_f) * 100) > BLOCK_JERK_PERCENTAGE
|
||||
end
|
||||
|
||||
def blocking_site_ids
|
||||
|
|
Loading…
Add table
Reference in a new issue