aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-11 22:09:23 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-11 22:09:23 -0400
commit16f435f9313daa9e00dad25e2bcf95e30ad736ed (patch)
tree8ecb3ed5d27daf09a3ef533ff36667ba4565e21b /activestorage/app
parenta1735a0dde6f6efa4cda6347da71a056740da1d3 (diff)
downloadrails-16f435f9313daa9e00dad25e2bcf95e30ad736ed.tar.gz
rails-16f435f9313daa9e00dad25e2bcf95e30ad736ed.tar.bz2
rails-16f435f9313daa9e00dad25e2bcf95e30ad736ed.zip
Discard ActiveStorage::PurgeJobs for missing blobs
Diffstat (limited to 'activestorage/app')
-rw-r--r--activestorage/app/jobs/active_storage/purge_job.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activestorage/app/jobs/active_storage/purge_job.rb b/activestorage/app/jobs/active_storage/purge_job.rb
index 95ae7d0c30..fa15e0451d 100644
--- a/activestorage/app/jobs/active_storage/purge_job.rb
+++ b/activestorage/app/jobs/active_storage/purge_job.rb
@@ -2,6 +2,8 @@
# Provides asynchronous purging of ActiveStorage::Blob records via ActiveStorage::Blob#purge_later.
class ActiveStorage::PurgeJob < ActiveStorage::BaseJob
+ discard_on ActiveRecord::RecordNotFound
+
def perform(blob)
blob.purge
end