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,25 +0,0 @@
class TagCorrectionsController < ApplicationController
respond_to :html, :json, :xml
before_action :builder_only, only: [:new, :create]
def new
@correction = TagCorrection.new(params[:tag_id])
respond_with(@correction)
end
def show
@correction = TagCorrection.new(params[:tag_id])
respond_with(@correction)
end
def create
@correction = TagCorrection.new(params[:tag_id])
if params[:commit] == "Fix"
@correction.fix!
redirect_to tags_path(:search => {:name_matches => @correction.tag.name, :hide_empty => "no"}), :notice => "Tag will be fixed in a few seconds"
else
redirect_to tags_path(:search => {:name_matches => @correction.tag.name})
end
end
end