Bust relationship cache key (#37760)
This commit is contained in:
parent
7e27ba990e
commit
1310628a60
@ -10,7 +10,7 @@ module RelationshipCacheable
|
|||||||
private
|
private
|
||||||
|
|
||||||
def remove_relationship_cache
|
def remove_relationship_cache
|
||||||
Rails.cache.delete(['relationship', account_id, target_account_id])
|
Rails.cache.delete(['relationships', account_id, target_account_id])
|
||||||
Rails.cache.delete(['relationship', target_account_id, account_id])
|
Rails.cache.delete(['relationships', target_account_id, account_id])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -114,6 +114,6 @@ class AccountRelationshipsPresenter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def relationship_cache_key(account_id)
|
def relationship_cache_key(account_id)
|
||||||
['relationship', @current_account_id, account_id]
|
['relationships', @current_account_id, account_id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -66,10 +66,10 @@ class MoveWorker
|
|||||||
# Clear any relationship cache, since callbacks are not called
|
# Clear any relationship cache, since callbacks are not called
|
||||||
Rails.cache.delete_multi(follows.flat_map do |follow|
|
Rails.cache.delete_multi(follows.flat_map do |follow|
|
||||||
[
|
[
|
||||||
['relationship', follow.account_id, follow.target_account_id],
|
['relationships', follow.account_id, follow.target_account_id],
|
||||||
['relationship', follow.target_account_id, follow.account_id],
|
['relationships', follow.target_account_id, follow.account_id],
|
||||||
['relationship', follow.account_id, @target_account.id],
|
['relationships', follow.account_id, @target_account.id],
|
||||||
['relationship', @target_account.id, follow.account_id],
|
['relationships', @target_account.id, follow.account_id],
|
||||||
]
|
]
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user