run tag count counters synchronously

This commit is contained in:
r888888888
2017-11-15 16:29:39 -08:00
parent e5cc6a7949
commit 7dea7eef89

View File

@@ -608,10 +608,10 @@ class Post < ApplicationRecord
increment_tags = tag_array - tag_array_was
if increment_tags.any?
Tag.delay(:queue => "default").increment_post_counts(increment_tags)
Tag.increment_post_counts(increment_tags)
end
if decrement_tags.any?
Tag.delay(:queue => "default").decrement_post_counts(decrement_tags)
Tag.decrement_post_counts(decrement_tags)
end
Post.expire_cache_for_all([""]) if new_record? || id <= 100_000
end