diff --git a/app/jobs/dossier_index_search_terms_job.rb b/app/jobs/dossier_index_search_terms_job.rb index 688171472..293d1c96a 100644 --- a/app/jobs/dossier_index_search_terms_job.rb +++ b/app/jobs/dossier_index_search_terms_job.rb @@ -1,4 +1,6 @@ class DossierIndexSearchTermsJob < ApplicationJob + queue_as :low_priority + discard_on ActiveRecord::RecordNotFound def perform(dossier) diff --git a/spec/mailers/instructeur_mailer_spec.rb b/spec/mailers/instructeur_mailer_spec.rb index e84dfde82..8fb916a28 100644 --- a/spec/mailers/instructeur_mailer_spec.rb +++ b/spec/mailers/instructeur_mailer_spec.rb @@ -12,7 +12,7 @@ RSpec.describe InstructeurMailer, type: :mailer do before { ENV['BULK_EMAIL_QUEUE'] = custom_queue } it 'enqueues email is custom queue for low priority delivery' do - expect { subject.deliver_later }.to have_enqueued_job.on_queue(custom_queue) + expect { subject.deliver_later }.to have_enqueued_job(PriorizedMailDeliveryJob).on_queue(custom_queue) end end end