]> cat aescling's git repositories - mastodon.git/commitdiff
Fix followers hash cache not being invalidated on account merge (#15256)
authorThibG <thib@sitedethib.com>
Wed, 2 Dec 2020 20:20:00 +0000 (21:20 +0100)
committerGitHub <noreply@github.com>
Wed, 2 Dec 2020 20:20:00 +0000 (21:20 +0100)
Also clear relationships cache.

app/models/concerns/account_merging.rb

index 691d02e03c903cf92faf5ad51160205dcd1a85c8..45050c269a33d9850874f1d1d46e88cdd4ced22a 100644 (file)
@@ -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