Skip to content
Snippets Groups Projects
Commit 1b63ccd8 authored by Olivier Wilkinson (reivilibre)'s avatar Olivier Wilkinson (reivilibre)
Browse files

Wrap `get_local_public_room_list` call in `maybeDeferred` because it

is cached and so does not always return a `Deferred`.
`await` does not silently pass-through non-Deferreds like `yield` used to.

Signed-off-by: default avatarOlivier Wilkinson (reivilibre) <olivier@librepush.net>
parent f70d0a1d
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,8 @@ import functools ...@@ -19,6 +19,8 @@ import functools
import logging import logging
import re import re
from twisted.internet.defer import maybeDeferred
import synapse import synapse
import synapse.logging.opentracing as opentracing import synapse.logging.opentracing as opentracing
from synapse.api.errors import Codes, FederationDeniedError, SynapseError from synapse.api.errors import Codes, FederationDeniedError, SynapseError
...@@ -745,8 +747,12 @@ class PublicRoomList(BaseFederationServlet): ...@@ -745,8 +747,12 @@ class PublicRoomList(BaseFederationServlet):
else: else:
network_tuple = ThirdPartyInstanceID(None, None) network_tuple = ThirdPartyInstanceID(None, None)
data = await self.handler.get_local_public_room_list( data = await maybeDeferred(
limit, since_token, network_tuple=network_tuple, from_federation=True self.handler.get_local_public_room_list,
limit,
since_token,
network_tuple=network_tuple,
from_federation=True,
) )
return 200, data return 200, data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment