mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Retry ActiveStorage::PurgeJobs on DB deadlock
This commit is contained in:
parent
57a91c4d42
commit
fee7fba893
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue