mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Clear affected relationship cache on Move activities (#37664)
This commit is contained in:
parent
1ba2b1cdc1
commit
ff20ce9acf
1 changed files with 10 additions and 0 deletions
|
|
@ -64,6 +64,16 @@ class MoveWorker
|
|||
.in_batches do |follows|
|
||||
ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id)
|
||||
num_moved += follows.update_all(target_account_id: @target_account.id)
|
||||
|
||||
# Clear any relationship cache, since callbacks are not called
|
||||
Rails.cache.delete_multi(follows.flat_map do |follow|
|
||||
[
|
||||
['relationship', follow.account_id, follow.target_account_id],
|
||||
['relationship', follow.target_account_id, follow.account_id],
|
||||
['relationship', follow.account_id, @target_account.id],
|
||||
['relationship', @target_account.id, follow.account_id],
|
||||
]
|
||||
end)
|
||||
end
|
||||
|
||||
num_moved
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue