aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-08-19 01:19:45 -0400
committerGeorge Claghorn <george@basecamp.com>2018-08-19 01:19:51 -0400
commit093d8d395329b2050def805ce7959fb6a3bda928 (patch)
tree124099c0d60a00a4176aa1544fb0e4bdcca631ca /activestorage
parent116fae6ef994dcc46d334a2dd652c1d7e977468e (diff)
downloadrails-093d8d395329b2050def805ce7959fb6a3bda928.tar.gz
rails-093d8d395329b2050def805ce7959fb6a3bda928.tar.bz2
rails-093d8d395329b2050def805ce7959fb6a3bda928.zip
Retry ActiveStorage::AnalyzeJobs on download integrity check failures
Diffstat (limited to 'activestorage')
-rw-r--r--activestorage/app/jobs/active_storage/analyze_job.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activestorage/app/jobs/active_storage/analyze_job.rb b/activestorage/app/jobs/active_storage/analyze_job.rb
index 2a952f9f74..804ee4557a 100644
--- a/activestorage/app/jobs/active_storage/analyze_job.rb
+++ b/activestorage/app/jobs/active_storage/analyze_job.rb
@@ -2,6 +2,8 @@
# Provides asynchronous analysis of ActiveStorage::Blob records via ActiveStorage::Blob#analyze_later.
class ActiveStorage::AnalyzeJob < ActiveStorage::BaseJob
+ retry_on ActiveStorage::IntegrityError, attempts: 10, wait: :exponentially_longer
+
def perform(blob)
blob.analyze
end