mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-24 08:29:25 -05:00
Make simple query rather than long one and then throw away half the results
This commit is contained in:
parent
b1ca784aca
commit
1d7702833d
@ -267,8 +267,7 @@ class MessageHandler(BaseHandler):
|
|||||||
user, pagination_config.get_source_config("presence"), None
|
user, pagination_config.get_source_config("presence"), None
|
||||||
)
|
)
|
||||||
|
|
||||||
public_rooms = yield self.store.get_rooms(is_public=True)
|
public_room_ids = yield self.store.get_public_room_ids()
|
||||||
public_room_ids = [r["room_id"] for r in public_rooms]
|
|
||||||
|
|
||||||
limit = pagin_config.limit
|
limit = pagin_config.limit
|
||||||
if limit is None:
|
if limit is None:
|
||||||
|
@ -75,6 +75,16 @@ class RoomStore(SQLBaseStore):
|
|||||||
allow_none=True,
|
allow_none=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_public_room_ids(self):
|
||||||
|
return self._simple_select_onecol(
|
||||||
|
table="rooms",
|
||||||
|
keyvalues={
|
||||||
|
"is_public": True,
|
||||||
|
},
|
||||||
|
retcol="room_id",
|
||||||
|
desc="get_public_room_ids",
|
||||||
|
)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def get_rooms(self, is_public):
|
def get_rooms(self, is_public):
|
||||||
"""Retrieve a list of all public rooms.
|
"""Retrieve a list of all public rooms.
|
||||||
|
Loading…
Reference in New Issue
Block a user