diff --git a/app/controllers/tag_alias_corrections_controller.rb b/app/controllers/tag_alias_corrections_controller.rb index 62aea1113..23c00b723 100644 --- a/app/controllers/tag_alias_corrections_controller.rb +++ b/app/controllers/tag_alias_corrections_controller.rb @@ -10,6 +10,7 @@ class TagAliasCorrectionsController < ApplicationController if params[:commit] == "Fix" @correction.fix! + flash[:notice] = "The fix has been queued and will be processed" end redirect_to tag_alias_correction_path(:id => params[:tag_alias_id]) diff --git a/app/logical/anonymous_user.rb b/app/logical/anonymous_user.rb index c490867f6..9b56ddac0 100644 --- a/app/logical/anonymous_user.rb +++ b/app/logical/anonymous_user.rb @@ -149,7 +149,7 @@ class AnonymousUser 0 end - %w(member banned privileged platinum contributor janitor moderator admin).each do |name| + %w(member banned privileged builder platinum contributor janitor moderator admin).each do |name| define_method("is_#{name}?") do false end diff --git a/app/logical/tag_alias_correction.rb b/app/logical/tag_alias_correction.rb index 971ca076d..92e4ee043 100644 --- a/app/logical/tag_alias_correction.rb +++ b/app/logical/tag_alias_correction.rb @@ -46,13 +46,13 @@ class TagAliasCorrection end def clear_cache - tag_alias.clear_cache + tag_alias.clear_all_cache end def fix! clear_cache tag_alias.update_cache - tag_alias.update_posts + tag_alias.delay.update_posts tag_alias.antecedent_tag.fix_post_count if tag_alias.antecedent_tag tag_alias.consequent_tag.fix_post_count if tag_alias.consequent_tag end diff --git a/app/models/tag_alias.rb b/app/models/tag_alias.rb index 7a1023413..b45587d5e 100644 --- a/app/models/tag_alias.rb +++ b/app/models/tag_alias.rb @@ -97,11 +97,11 @@ class TagAlias < ActiveRecord::Base def clear_all_cache Danbooru.config.all_server_hosts.each do |host| - delay(:queue => host).clear_cache(host) + delay(:queue => host).clear_cache end end - def clear_cache(host = Socket.gethostname) + def clear_cache Cache.delete("ta:#{Cache.sanitize(antecedent_name)}") Cache.delete("ta:#{Cache.sanitize(consequent_name)}") end diff --git a/app/views/tag_alias_corrections/show.html.erb b/app/views/tag_alias_corrections/show.html.erb index cae64dfd3..cac335921 100644 --- a/app/views/tag_alias_corrections/show.html.erb +++ b/app/views/tag_alias_corrections/show.html.erb @@ -1,15 +1,15 @@

Tag Alias Correction: <%= @correction.antecedent_name %> -> <%= @correction.consequent_name %>

-

Because tag aliases are cached in memory, they may go out of sync. This action will clear out the cache and fix and lingering posts.

+

Because tag aliases are cached in memory, they may go out of sync. This action will clear out the cache and fix any lingering posts.

-<% @correction.each_server do |correction| %> +<% @correction.each_server do |server| %>
-

Server: <%= Socket.gethostname %>

+

Server: <%= server.hostname %>

<% end %>