fix: Retry job if file not found (#11683)

Removed StandardError rescue blocks and added retry_on for
ResponseBuilderJob and AudioTranscriptionJob
This commit is contained in:
Pranav
2025-06-05 22:53:11 -05:00
committed by GitHub
parent 10363e77ad
commit 9b43a0f72b
4 changed files with 8 additions and 25 deletions

View File

@@ -12,15 +12,9 @@ class Messages::AudioTranscriptionService < Llm::BaseOpenAiService
return { error: 'Transcription limit exceeded' } unless can_transcribe?
return { error: 'Message not found' } if message.blank?
begin
transcriptions = transcribe_audio
Rails.logger.info "Audio transcription successful: #{transcriptions}"
{ success: true, transcriptions: transcriptions }
rescue StandardError => e
ChatwootExceptionTracker.new(e).capture_exception
Rails.logger.error "Audio transcription failed: #{e.message}"
{ error: "Transcription failed: #{e.message}" }
end
transcriptions = transcribe_audio
Rails.logger.info "Audio transcription successful: #{transcriptions}"
{ success: true, transcriptions: transcriptions }
end
private