posts: fix search queries not being logged to NewRelic in some cases (#4900)

Fix the /posts index controller not logging the normalized search query
to NewRelic when the search failed, either because of a tag limit error,
a search timeout, or a RSS feed rate limit error.

Also don't log the number of search results when it's an API request or
failed search. This is to avoid doing a potentially slow full post count
when it's not otherwise needed.
This commit is contained in:
evazion
2022-01-11 13:22:24 -06:00
parent 698d732667
commit 1518c3c4be
5 changed files with 30 additions and 28 deletions

View File

@@ -134,7 +134,7 @@
<%= render PopupMenuComponent.new(classes: "post-preview-options-menu") do |menu| %>
<% menu.item do %>
<% if @show_votes %>
<% if @post_set.show_votes %>
<%= link_to "Hide scores", posts_path(tags: params[:tags], page: params[:page], limit: params[:limit], show_votes: nil, size: params[:size]), class: "post-preview-hide-votes", rel: "nofollow" %>
<% else %>
<%= link_to "Show scores", posts_path(tags: params[:tags], page: params[:page], limit: params[:limit], show_votes: true, size: params[:size]), class: "post-preview-show-votes", rel: "nofollow" %>