diff --git a/app/jobs/send_on_slack_job.rb b/app/jobs/send_on_slack_job.rb index 2503be121..eececa409 100644 --- a/app/jobs/send_on_slack_job.rb +++ b/app/jobs/send_on_slack_job.rb @@ -1,6 +1,6 @@ class SendOnSlackJob < MutexApplicationJob queue_as :medium - retry_on LockAcquisitionError, wait: 1.second, attempts: 6 + retry_on LockAcquisitionError, wait: 1.second, attempts: 8 def perform(message, hook) with_lock(::Redis::Alfred::SLACK_MESSAGE_MUTEX, conversation_id: message.conversation_id, reference_id: hook.reference_id) do diff --git a/lib/redis/lock_manager.rb b/lib/redis/lock_manager.rb index d8017a49e..63063542c 100644 --- a/lib/redis/lock_manager.rb +++ b/lib/redis/lock_manager.rb @@ -12,10 +12,10 @@ # end # class Redis::LockManager - # Default lock timeout set to 2 seconds. This means that if the lock isn't released - # within 2 seconds, it will automatically expire. + # Default lock timeout set to 1 second. This means that if the lock isn't released + # within 1 second, it will automatically expire. # This helps to avoid deadlocks in case the process holding the lock crashes or fails to release it. - LOCK_TIMEOUT = 2.seconds + LOCK_TIMEOUT = 1.second # Attempts to acquire a lock for the given key. #