diff --git a/app/jobs/send_on_slack_job.rb b/app/jobs/send_on_slack_job.rb index 315334c3c..2503be121 100644 --- a/app/jobs/send_on_slack_job.rb +++ b/app/jobs/send_on_slack_job.rb @@ -3,7 +3,7 @@ class SendOnSlackJob < MutexApplicationJob retry_on LockAcquisitionError, wait: 1.second, attempts: 6 def perform(message, hook) - with_lock(::Redis::Alfred::SLACK_MESSAGE_MUTEX, sender_id: message.sender_id, reference_id: hook.reference_id) do + with_lock(::Redis::Alfred::SLACK_MESSAGE_MUTEX, conversation_id: message.conversation_id, reference_id: hook.reference_id) do Integrations::Slack::SendOnSlackService.new(message: message, hook: hook).perform end end diff --git a/lib/redis/redis_keys.rb b/lib/redis/redis_keys.rb index 65f966037..dc0b672ef 100644 --- a/lib/redis/redis_keys.rb +++ b/lib/redis/redis_keys.rb @@ -37,5 +37,5 @@ module Redis::RedisKeys ## Sempahores / Locks # We don't want to process messages from the same sender concurrently to prevent creating double conversations FACEBOOK_MESSAGE_MUTEX = 'FB_MESSAGE_CREATE_LOCK::%s::%s'.freeze - SLACK_MESSAGE_MUTEX = 'SLACK_MESSAGE_LOCK::%s::%s'.freeze + SLACK_MESSAGE_MUTEX = 'SLACK_MESSAGE_LOCK::%s::%s'.freeze end