mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-17 13:13:51 +01:00
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>
This commit is contained in:
parent
f70d0a1dd9
commit
1b63ccd848
1 changed files with 8 additions and 2 deletions
|
@ -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):
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue