feat: implement mutex for SlackSendJob (#7783)
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
class SendOnSlackJob < ApplicationJob
|
||||
class SendOnSlackJob < MutexApplicationJob
|
||||
queue_as :medium
|
||||
retry_on LockAcquisitionError, wait: 1.second, attempts: 6
|
||||
|
||||
def perform(message, hook)
|
||||
Integrations::Slack::SendOnSlackService.new(message: message, hook: hook).perform
|
||||
with_lock(::Redis::Alfred::SLACK_MESSAGE_MUTEX, sender_id: message.sender_id, reference_id: hook.reference_id) do
|
||||
Integrations::Slack::SendOnSlackService.new(message: message, hook: hook).perform
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user