mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 05:55:19 +01:00
Log BackupWorker backtrace, delete Backup if retries exhausted (#6769)
This commit is contained in:
parent
8bf3e750ab
commit
9e3a6d6784
@ -3,7 +3,16 @@
|
|||||||
class BackupWorker
|
class BackupWorker
|
||||||
include Sidekiq::Worker
|
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)
|
def perform(backup_id)
|
||||||
backup = Backup.find(backup_id)
|
backup = Backup.find(backup_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user