Rename with_lock
to with_redis_lock
to avoid confusion with ActiveRecord's method (#24741)
This commit is contained in:
@@ -24,7 +24,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||
# The key does not need to be unguessable, it just needs to be somewhat unique
|
||||
@options[:request_id] ||= "#{Time.now.utc.to_i}-#{username}@#{domain}"
|
||||
|
||||
with_lock("process_account:#{@uri}") do
|
||||
with_redis_lock("process_account:#{@uri}") do
|
||||
@account = Account.remote.find_by(uri: @uri) if @options[:only_key]
|
||||
@account ||= Account.find_remote(@username, @domain)
|
||||
@old_public_key = @account&.public_key
|
||||
|
@@ -35,7 +35,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
|
||||
last_edit_date = @status.edited_at.presence || @status.created_at
|
||||
|
||||
# Only allow processing one create/update per status at a time
|
||||
with_lock("create:#{@uri}") do
|
||||
with_redis_lock("create:#{@uri}") do
|
||||
Status.transaction do
|
||||
record_previous_edit!
|
||||
update_media_attachments!
|
||||
@@ -58,7 +58,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
|
||||
end
|
||||
|
||||
def handle_implicit_update!
|
||||
with_lock("create:#{@uri}") do
|
||||
with_redis_lock("create:#{@uri}") do
|
||||
update_poll!(allow_significant_changes: false)
|
||||
queue_poll_notifications!
|
||||
end
|
||||
|
Reference in New Issue
Block a user