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

Commit

Permalink
Don't expire get_users_who_share_room & friends
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Sep 15, 2021
1 parent c9fb203 commit 361ffb8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _check_safe_current_state_events_membership_updated_txn(self, txn):
self._check_safe_current_state_events_membership_updated_txn,
)

@cached(max_entries=100000, iterable=True)
@cached(max_entries=100000, iterable=True, prune_unread_entries=False)
async def get_users_in_room(self, room_id: str) -> List[str]:
return await self.db_pool.runInteraction(
"get_users_in_room", self.get_users_in_room_txn, room_id
Expand Down Expand Up @@ -439,7 +439,7 @@ async def get_local_current_membership_for_user_in_room(

return results_dict.get("membership"), results_dict.get("event_id")

@cached(max_entries=500000, iterable=True)
@cached(max_entries=500000, iterable=True, prune_unread_entries=False)
async def get_rooms_for_user_with_stream_ordering(
self, user_id: str
) -> FrozenSet[GetRoomsForUserWithStreamOrdering]:
Expand Down Expand Up @@ -544,7 +544,12 @@ async def get_rooms_for_user(
)
return frozenset(r.room_id for r in rooms)

@cached(max_entries=500000, cache_context=True, iterable=True)
@cached(
max_entries=500000,
cache_context=True,
iterable=True,
prune_unread_entries=False,
)
async def get_users_who_share_room_with_user(
self, user_id: str, cache_context: _CacheContext
) -> Set[str]:
Expand Down

0 comments on commit 361ffb8

Please sign in to comment.