diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-10-04 17:36:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-04 17:36:11 +0200 |
commit | a46ab86adfc9e4ea182af9a555237f17071e194c (patch) | |
tree | ed5d073badf675fdc0661c54467cc52de85c90b2 /app/workers | |
parent | 186024a058d4b8765a10d87ff3d7f3bdcd2fbb3c (diff) |
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
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/import_worker.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/workers/import_worker.rb b/app/workers/import_worker.rb index d7c126f75..aeb221cf6 100644 --- a/app/workers/import_worker.rb +++ b/app/workers/import_worker.rb @@ -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 |