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

Room Directory: Wrap get_local_public_room_list call in maybeDeferred #5851

Merged
merged 3 commits into from
Aug 15, 2019
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
2 changes: 2 additions & 0 deletions changelog.d/5851.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix 500 Internal Server Error on `publicRooms` when the public room list was
cached.
10 changes: 8 additions & 2 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import logging
import re

from twisted.internet.defer import maybeDeferred

import synapse
import synapse.logging.opentracing as opentracing
from synapse.api.errors import Codes, FederationDeniedError, SynapseError
Expand Down Expand Up @@ -745,8 +747,12 @@ async def on_GET(self, origin, content, query):
else:
network_tuple = ThirdPartyInstanceID(None, None)

data = await self.handler.get_local_public_room_list(
limit, since_token, network_tuple=network_tuple, from_federation=True
data = await maybeDeferred(
self.handler.get_local_public_room_list,
limit,
since_token,
network_tuple=network_tuple,
from_federation=True,
)
return 200, data

Expand Down