feat: log timeout search terms

This commit is contained in:
simon lehericey 2024-12-06 11:09:01 +01:00
parent 7f0618e6ef
commit 2b749b2c5b
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -71,6 +71,23 @@ class RechercheController < ApplicationController
else else
return return
end end
rescue ActiveRecord::QueryCanceled => e
Sentry.capture_exception(e)
logger = Lograge.logger || Rails.logger
payload = {
message: 'search timeout',
user_id: current_user.id,
request_id: Current.request_id,
controller: self.class.name,
terms: @search_terms
}
logger.info(payload.to_json)
redirect_to recherche_index_path, alert: "La recherche n'a pas pu aboutir."
end end
private private