1
0
Fork 0
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:
George Claghorn 2018-07-31 19:29:23 -04:00
parent 57a91c4d42
commit fee7fba893

View file

@ -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