about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-03-13 18:17:20 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-03-13 18:17:20 +0000
commitd75a6054a04820610d8386338faed256e59c143e (patch)
tree7b899154077b03640300136ab662514d97f76904 /app/workers
parentf8e934f95551179de48a716d4f148bb7bec638d1 (diff)
parentfd385e256d1ca99fa9a6f1bd8068d083cb0e39ba (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/backup_worker.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/workers/backup_worker.rb b/app/workers/backup_worker.rb
index ec6db4e9e..e4c609d70 100644
--- a/app/workers/backup_worker.rb
+++ b/app/workers/backup_worker.rb
@@ -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)