Files
assistant-storefront/enterprise/app/jobs/messages/audio_transcription_job.rb

13 lines
338 B
Ruby
Raw Permalink Normal View History

class Messages::AudioTranscriptionJob < ApplicationJob
queue_as :low
retry_on ActiveStorage::FileNotFoundError, wait: 2.seconds, attempts: 3
def perform(attachment_id)
attachment = Attachment.find_by(id: attachment_id)
return if attachment.blank?
Messages::AudioTranscriptionService.new(attachment).perform
end
end