0
0
Fork 0

Limit the number of people that can be followed from one account (#8807)

Configurable soft limit of 7,500, and above that, configurable
ratio of 1.1 * followers, controlled by:

- MAX_FOLLOWS_THRESHOLD
- MAX_FOLLOWS_RATIO

Fix #2311
This commit is contained in:
Eugen Rochko 2018-10-04 17:36:11 +02:00 committed by GitHub
parent 186024a058
commit a46ab86adf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 1 deletions

View file

@ -37,6 +37,8 @@ class ImportWorker
end
def import_rows
CSV.new(import_contents).reject(&:blank?)
rows = CSV.new(import_contents).reject(&:blank?)
rows = rows.take(FollowLimitValidator.limit_for_account(@import.account)) if @import.type == 'following'
rows
end
end