diff options
author | Erik Johnston <erik@matrix.org> | 2016-12-16 16:11:43 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-12-16 16:11:43 +0000 |
commit | b2f8642d3df30c88704e02422325b394880f66eb (patch) | |
tree | 8c1972c8ec3f36d910ef29ebc313a6656877981a | |
parent | Merge branch 'release-v0.18.5' of github.com:matrix-org/synapse (diff) | |
download | synapse-b2f8642d3df30c88704e02422325b394880f66eb.tar.xz |
Cache network room list queries.
-rw-r--r-- | synapse/handlers/room_list.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py index 667223df0c..19eebbd43f 100644 --- a/synapse/handlers/room_list.py +++ b/synapse/handlers/room_list.py @@ -62,17 +62,18 @@ class RoomListHandler(BaseHandler): appservice and network id to use an appservice specific one. Setting to None returns all public rooms across all lists. """ - if search_filter or (network_tuple and network_tuple.appservice_id is not None): + if search_filter: # We explicitly don't bother caching searches or requests for # appservice specific lists. return self._get_public_room_list( limit, since_token, search_filter, network_tuple=network_tuple, ) - result = self.response_cache.get((limit, since_token)) + key = (limit, since_token, network_tuple) + result = self.response_cache.get(key) if not result: result = self.response_cache.set( - (limit, since_token), + key, self._get_public_room_list( limit, since_token, network_tuple=network_tuple ) |