tags: automatically fix incorrect tag counts during maintenance.

* Automatically fix all tags with incorrect counts during daily
  maintenance (previously only tags with negative counts were fixed).
* Log fixed tags to NewRelic.
* Remove the ability to manually fix tag counts with the "Fix" button on
  the /tags listing. This is no longer necessary now that tags are
  fixed automatically.
This commit is contained in:
evazion
2019-09-25 17:33:15 -05:00
parent 03d9b3feca
commit bc34fb16a4
12 changed files with 36 additions and 89 deletions

View File

@@ -1,19 +0,0 @@
<div id="c-tag-corrections">
<div id="a-new">
<h1>Fix Tag: <%= @correction.tag.name %></h1>
<div style="margin-bottom: 1em;">
<ul>
<li><strong>category actual</strong>: <%= @correction.category %></li>
<li><strong>category memcache</strong>: <%= @correction.category_cache || "none" %></li>
<li><strong>post count db cache</strong>: <%= @correction.post_count %></li>
<li><strong>post count actual:</strong> <%= @correction.real_post_count %></li>
</ul>
</div>
<%= form_tag(tag_correction_path(:tag_id => @correction.tag.id)) do %>
<%= submit_tag "Fix" %>
<%= submit_tag "Cancel" %>
<% end %>
</div>
</div>

View File

@@ -9,8 +9,5 @@
<li>|</li>
<%= subnav_link_to "Posts (#{@tag.post_count})", posts_path(:tags => @tag.name) %>
<%= subnav_link_to "Edit", edit_tag_path(@tag) %>
<% if @tag.post_count < 1_000 %>
<%= subnav_link_to "Fix", new_tag_correction_path(:tag_id => @tag.id) %>
<% end %>
<% end %>
<% end %>

View File

@@ -21,9 +21,6 @@
<% if tag.editable_by?(CurrentUser.user) %>
<%= link_to "edit", edit_tag_path(tag) %>
<% end %>
<% if CurrentUser.is_builder? %>
| <%= link_to "fix", new_tag_correction_path(:tag_id => tag.id) %>
<% end %>
</td>
</tr>
<% end %>