Merge pull request #10448 from colinux/increase-search-debounce-delay

Tech: limite l'engorgement des DossierIndexSearchTermsJob
This commit is contained in:
Colin Darie 2024-05-27 08:18:37 +00:00 committed by GitHub
commit 8431771a61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -1,4 +1,6 @@
class DossierIndexSearchTermsJob < ApplicationJob
queue_as :low_priority
discard_on ActiveRecord::RecordNotFound
def perform(dossier)

View file

@ -6,7 +6,7 @@ module DossierSearchableConcern
included do
after_commit :index_search_terms_later, if: -> { previously_new_record? || user_previously_changed? || mandataire_first_name_previously_changed? || mandataire_last_name_previously_changed? }
SEARCH_TERMS_DEBOUNCE = 30.seconds
SEARCH_TERMS_DEBOUNCE = 5.minutes
kredis_flag :debounce_index_search_terms_flag

View file

@ -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