diff options
author | Erik Johnston <erikj@jki.re> | 2017-03-24 11:40:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 11:40:08 +0000 |
commit | 57cfa513f5ff939d88ebb3a213d977517395a631 (patch) | |
tree | 6e658aa7007fd8f890a631c5ea8c654b721d375d /synapse/storage/room.py | |
parent | Merge pull request #2055 from matrix-org/dbkr/fix_add_msisdn_requestToken (diff) | |
parent | Replace some calls to cursor_to_dict (diff) | |
download | synapse-57cfa513f5ff939d88ebb3a213d977517395a631.tar.xz |
Merge pull request #2054 from matrix-org/erikj/user_iter_cursor
Reduce some CPU work on DB threads
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r-- | synapse/storage/room.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py index 8a2fe2fdf5..e4c56cc175 100644 --- a/synapse/storage/room.py +++ b/synapse/storage/room.py @@ -396,7 +396,7 @@ class RoomStore(SQLBaseStore): sql % ("AND appservice_id IS NULL",), (stream_id,) ) - return dict(txn.fetchall()) + return dict(txn) else: # We want to get from all lists, so we need to aggregate the results @@ -422,7 +422,7 @@ class RoomStore(SQLBaseStore): results = {} # A room is visible if its visible on any list. - for room_id, visibility in txn.fetchall(): + for room_id, visibility in txn: results[room_id] = bool(visibility) or results.get(room_id, False) return results |