Log BackupWorker backtrace, delete Backup if retries exhausted (#6769)
parent
aef3f2775e
commit
3a29705806
|
@ -3,7 +3,16 @@
|
|||
class BackupWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
sidekiq_options queue: 'pull'
|
||||
sidekiq_options queue: 'pull', backtrace: true, retry: 5, dead: false
|
||||
|
||||
sidekiq_retries_exhausted do |msg|
|
||||
backup_id = msg['args'].first
|
||||
|
||||
ActiveRecord::Base.connection_pool.with_connection do
|
||||
backup = Backup.find(backup_id)
|
||||
backup&.destroy
|
||||
end
|
||||
end
|
||||
|
||||
def perform(backup_id)
|
||||
backup = Backup.find(backup_id)
|
||||
|
|
Loading…
Reference in New Issue