Rename with_lock to with_redis_lock to avoid confusion with ActiveRecord's method (#24741)
				
					
				
			This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user