Rename with_lock
to with_redis_lock
to avoid confusion with ActiveRecord's method (#24741)
This commit is contained in:
parent
a7df578f97
commit
f1c1dd0118
16 changed files with 19 additions and 26 deletions
|
@ -47,7 +47,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
def create_status
|
||||
return reject_payload! if unsupported_object_type? || non_matching_uri_hosts?(@account.uri, object_uri) || tombstone_exists? || !related_to_local_activity?
|
||||
|
||||
with_lock("create:#{object_uri}") do
|
||||
with_redis_lock("create:#{object_uri}") do
|
||||
return if delete_arrived_first?(object_uri) || poll_vote?
|
||||
|
||||
@status = find_existing_status
|
||||
|
@ -313,7 +313,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
poll = replied_to_status.preloadable_poll
|
||||
already_voted = true
|
||||
|
||||
with_lock("vote:#{replied_to_status.poll_id}:#{@account.id}") do
|
||||
with_redis_lock("vote:#{replied_to_status.poll_id}:#{@account.id}") do
|
||||
already_voted = poll.votes.where(account: @account).exists?
|
||||
poll.votes.create!(account: @account, choice: poll.options.index(@object['name']), uri: object_uri)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue