2017-10-22 13:16:59 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Provides asynchronous analysis of ActiveStorage::Blob records via ActiveStorage::Blob#analyze_later.
|
2017-11-03 11:29:21 -04:00
|
|
|
class ActiveStorage::AnalyzeJob < ActiveStorage::BaseJob
|
2019-01-01 19:40:59 -05:00
|
|
|
queue_as { ActiveStorage.queues[:analysis] }
|
|
|
|
|
2019-09-28 10:28:21 -04:00
|
|
|
discard_on ActiveRecord::RecordNotFound
|
2018-08-19 01:19:45 -04:00
|
|
|
retry_on ActiveStorage::IntegrityError, attempts: 10, wait: :exponentially_longer
|
|
|
|
|
2017-10-22 13:16:59 -04:00
|
|
|
def perform(blob)
|
|
|
|
blob.analyze
|
|
|
|
end
|
|
|
|
end
|