Revert "Clear recent articles cache on updating tags (#14298)" (#14330)

This reverts commit 7159199402.
This commit is contained in:
rhymes 2021-07-26 11:12:33 +02:00 committed by GitHub
parent 7159199402
commit e081551dc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 20 deletions

View file

@ -35,8 +35,7 @@ class Tag < ActsAsTaggableOn::Tag
before_save :mark_as_updated
after_commit :bust_cache
after_update_commit :bust_articles_cache
pg_search_scope :search_by_name,
against: :name,
using: { tsearch: { prefix: true } }
@ -102,13 +101,6 @@ class Tag < ActsAsTaggableOn::Tag
Tags::BustCacheWorker.perform_async(name)
end
def bust_articles_cache
article_ids = articles.published.order(created_at: :desc).limit(100).ids
article_ids.each_slice(10) do |ids|
Articles::BustMultipleCachesWorker.perform_async(ids)
end
end
def validate_alias_for
return if Tag.exists?(name: alias_for)

View file

@ -122,17 +122,6 @@ RSpec.describe Tag, type: :model do
end
end
it "triggers articles cache busting on save" do
sidekiq_perform_enqueued_jobs do
tag.save
end
first = create(:article, tags: tag.name, published: true)
second = create(:article, tags: tag.name, published: true)
sidekiq_assert_enqueued_with(job: Articles::BustMultipleCachesWorker, args: [[second.id, first.id]]) do
tag.save
end
end
it "finds mod chat channel" do
channel = create(:chat_channel)
tag.mod_chat_channel_id = channel.id