about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-12-02 21:20:00 +0100
committerGitHub <noreply@github.com>2020-12-02 21:20:00 +0100
commit9136be480f9660dcdf0e5a17ed929e2eb5ee650c (patch)
tree7efd1976cc84515e621172b011f6c4f92579ec28 /app
parentfbff89be037c751932c720b0d5cd9221e430be5f (diff)
Fix followers hash cache not being invalidated on account merge (#15256)
Also clear relationships cache.
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/account_merging.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/concerns/account_merging.rb b/app/models/concerns/account_merging.rb
index 691d02e03..45050c269 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