From fee7fba8934ee6005b7e8eefc4baf7db48f03934 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Tue, 31 Jul 2018 19:29:23 -0400 Subject: Retry ActiveStorage::PurgeJobs on DB deadlock --- activestorage/app/jobs/active_storage/purge_job.rb | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3