about summary refs log tree commit diff
path: root/app/workers/unfollow_follow_worker.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-12-26 23:52:46 +0100
committerGitHub <noreply@github.com>2020-12-26 23:52:46 +0100
commitf1f96ebf02e96d21d84c52825cbac623b66488f8 (patch)
treeb0185cd71c95891a5aa04f859db0e213d66f32f3 /app/workers/unfollow_follow_worker.rb
parent4580129c987371b656a8ab19feba09fb98f9fac1 (diff)
Fix being able to import more than allowed number of follows (#15384)
* Fix being able to import more than allowed number of follows

Without this commit, if someone tries importing a second list of accounts to
follow before the first one has been processed, this will queue imports for
the two whole lists, even if they exceed the account's allowed number of
outgoing follows.

This commit changes it so the individual queued imports aren't exempt from
the follow limit check (they remain exempt from the rate-limiting check
though).

* Catch validation errors to not re-queue failed follows

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/workers/unfollow_follow_worker.rb')
-rw-r--r--app/workers/unfollow_follow_worker.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/workers/unfollow_follow_worker.rb b/app/workers/unfollow_follow_worker.rb
index 71b5a0e3f..0bd5ff472 100644
--- a/app/workers/unfollow_follow_worker.rb
+++ b/app/workers/unfollow_follow_worker.rb
@@ -14,7 +14,7 @@ class UnfollowFollowWorker
     reblogs = follow&.show_reblogs?
     notify  = follow&.notify?
 
-    FollowService.new.call(follower_account, new_target_account, reblogs: reblogs, notify: notify, bypass_locked: bypass_locked)
+    FollowService.new.call(follower_account, new_target_account, reblogs: reblogs, notify: notify, bypass_locked: bypass_locked, bypass_limit: true)
     UnfollowService.new.call(follower_account, old_target_account, skip_unmerge: true)
   rescue ActiveRecord::RecordNotFound, Mastodon::NotPermittedError
     true