Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Make get_account_data_for_room_and_type a tree cache #11789

Merged
merged 2 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11789.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove account data (including client config, push rules and ignored users) upon user deactivation.
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/account_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def get_account_data_for_room_txn(
"get_account_data_for_room", get_account_data_for_room_txn
)

@cached(num_args=3, max_entries=5000)
@cached(num_args=3, max_entries=5000, tree=True)
async def get_account_data_for_room_and_type(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems OK, where we invalid this it looks like we do something weird with whether there's a room_id or not, but I don't think that would change from this PR.

self, user_id: str, room_id: str, account_data_type: str
) -> Optional[JsonDict]:
Expand Down