diff --git a/app/logical/tag_correction.rb b/app/logical/tag_correction.rb index 2c8b9fdf9..78c15a84b 100644 --- a/app/logical/tag_correction.rb +++ b/app/logical/tag_correction.rb @@ -20,6 +20,6 @@ class TagCorrection def fix! tag.delay(:queue => "default").fix_post_count - tag.update_category_cache_for_all + tag.update_category_cache end end diff --git a/app/models/tag.rb b/app/models/tag.rb index d156db16e..50c275c0a 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -21,7 +21,7 @@ class Tag < ApplicationRecord validates :name, uniqueness: true, tag_name: true, on: :create validates_inclusion_of :category, in: TagCategory.category_ids - after_save :update_category_cache_for_all, if: ->(rec) { rec.saved_change_to_attribute?(:category)} + after_save :update_category_cache, if: ->(rec) { rec.saved_change_to_attribute?(:category)} module ApiMethods def to_legacy_json @@ -137,11 +137,6 @@ class Tag < ApplicationRecord TagCategory.reverse_mapping[category].capitalize end - def update_category_cache_for_all - update_category_cache - delay(:queue => "default", :priority => 10).update_category_post_counts - end - def update_category_post_counts Post.with_timeout(30_000, nil, {:tags => name}) do Post.raw_tag_match(name).where("true /* Tag#update_category_post_counts */").find_each do |post|