Skip to content
Snippets Groups Projects
Unverified Commit 52f4e834 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix concurrent unfollowing decrementing follower count more than once (#18527)

parent 8a9acbe6
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
class UnfollowService < BaseService
include Payloadable
include Redisable
include Lockable
# Unfollow and notify the remote user
# @param [Account] source_account Where to unfollow from
......@@ -13,7 +15,9 @@ class UnfollowService < BaseService
@target_account = target_account
@options = options
unfollow! || undo_follow_request!
with_lock("relationship:#{[source_account.id, target_account.id].sort.join(':')}") do
unfollow! || undo_follow_request!
end
end
private
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment