aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-31 19:29:23 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-31 19:29:23 -0400
commitfee7fba8934ee6005b7e8eefc4baf7db48f03934 (patch)
tree96c1810a8c5c3aad5b2ab7693f92c2ffdfb49ab5
parent57a91c4d4232b5a18f1514e82e7bc8d23254cfeb (diff)
downloadrails-fee7fba8934ee6005b7e8eefc4baf7db48f03934.tar.gz
rails-fee7fba8934ee6005b7e8eefc4baf7db48f03934.tar.bz2
rails-fee7fba8934ee6005b7e8eefc4baf7db48f03934.zip
Retry ActiveStorage::PurgeJobs on DB deadlock
-rw-r--r--activestorage/app/jobs/active_storage/purge_job.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activestorage/app/jobs/active_storage/purge_job.rb b/activestorage/app/jobs/active_storage/purge_job.rb
index fa15e0451d..2604977bf1 100644
--- a/activestorage/app/jobs/active_storage/purge_job.rb
+++ b/activestorage/app/jobs/active_storage/purge_job.rb
@@ -3,6 +3,7 @@
# Provides asynchronous purging of ActiveStorage::Blob records via ActiveStorage::Blob#purge_later.
class ActiveStorage::PurgeJob < ActiveStorage::BaseJob
discard_on ActiveRecord::RecordNotFound
+ retry_on ActiveRecord::Deadlocked, attempts: 10, wait: :exponentially_longer
def perform(blob)
blob.purge