use cache for fetching categories
This commit is contained in:
@@ -141,7 +141,7 @@ class Tag < ApplicationRecord
|
||||
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|
|
||||
post.reload
|
||||
post.set_tag_counts
|
||||
post.set_tag_counts(false)
|
||||
args = TagCategory.categories.map {|x| ["tag_count_#{x}",post.send("tag_count_#{x}")]}.to_h.update(:tag_count => post.tag_count)
|
||||
Post.where(:id => post.id).update_all(args)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user