diff options
author | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-08-14 14:05:50 +0100 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-08-14 14:53:49 +0100 |
commit | 1b63ccd8483e99aa7ea72b91f99f4cd94ded2e36 (patch) | |
tree | 556f27262958ca5b52b4a15f1ea8c05aa2f2a3a1 /synapse/federation/transport/server.py | |
parent | 1.3.0rc1 (diff) | |
download | synapse-1b63ccd8483e99aa7ea72b91f99f4cd94ded2e36.tar.xz |
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: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Diffstat (limited to 'synapse/federation/transport/server.py')
-rw-r--r-- | synapse/federation/transport/server.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py index ea4e1b6d0f..9a86bd0263 100644 --- a/synapse/federation/transport/server.py +++ b/synapse/federation/transport/server.py @@ -19,6 +19,8 @@ import functools 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 @@ -745,8 +747,12 @@ class PublicRoomList(BaseFederationServlet): 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 |