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

Commit

Permalink
Land improved room list based on room stats (#6019)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 26, 2020
2 parents 3a2008d + a5166e4 commit 4ab5cf8
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 350 deletions.
1 change: 1 addition & 0 deletions changelog.d/6019.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve performance of the public room list directory.
8 changes: 8 additions & 0 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,10 @@ async def on_GET(self, origin, content, query):
else:
network_tuple = ThirdPartyInstanceID(None, None)

if limit == 0:
# zero is a special value which corresponds to no limit.
limit = None

data = await maybeDeferred(
self.handler.get_local_public_room_list,
limit,
Expand Down Expand Up @@ -800,6 +804,10 @@ async def on_POST(self, origin, content, query):
if search_filter is None:
logger.warning("Nonefilter")

if limit == 0:
# zero is a special value which corresponds to no limit.
limit = None

data = await self.handler.get_local_public_room_list(
limit=limit,
since_token=since_token,
Expand Down
Loading

0 comments on commit 4ab5cf8

Please sign in to comment.