From 9136be480f9660dcdf0e5a17ed929e2eb5ee650c Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 2 Dec 2020 21:20:00 +0100 Subject: [PATCH] Fix followers hash cache not being invalidated on account merge (#15256) Also clear relationships cache. --- app/models/concerns/account_merging.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/concerns/account_merging.rb b/app/models/concerns/account_merging.rb index 691d02e03c9..45050c269a3 100644 --- a/app/models/concerns/account_merging.rb +++ b/app/models/concerns/account_merging.rb @@ -39,5 +39,10 @@ module AccountMerging end end end + + # Some follow relationships have moved, so the cache is stale + Rails.cache.delete_matched("followers_hash:#{id}:*") + Rails.cache.delete_matched("relationships:#{id}:*") + Rails.cache.delete_matched("relationships:*:#{id}") end end