Convert get_rooms to use runInteraction so the transacion has a more helpful description

This commit is contained in:
Erik Johnston 2015-02-11 18:56:13 +00:00
parent 2bf0e85f3d
commit 8bbdf32849

View file

@ -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 = [
{