mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-29 15:39:00 +03:00
Convert get_rooms to use runInteraction so the transacion has a more helpful description
This commit is contained in:
parent
2bf0e85f3d
commit
8bbdf32849
1 changed files with 38 additions and 31 deletions
|
@ -82,6 +82,7 @@ class RoomStore(SQLBaseStore):
|
|||
"topic" key if one is set, and a "name" key if one is set
|
||||
"""
|
||||
|
||||
def f(txn):
|
||||
topic_subquery = (
|
||||
"SELECT topics.event_id as event_id, "
|
||||
"topics.room_id as room_id, topic "
|
||||
|
@ -113,7 +114,13 @@ class RoomStore(SQLBaseStore):
|
|||
"name": name_subquery,
|
||||
}
|
||||
|
||||
rows = yield self._execute(None, sql, is_public)
|
||||
c = txn.execute(sql, (is_public,))
|
||||
|
||||
return c.fetchall()
|
||||
|
||||
rows = yield self.runInteraction(
|
||||
"get_rooms", f
|
||||
)
|
||||
|
||||
ret = [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue