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/receipts.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/receipts.py')
-rw-r--r-- | synapse/storage/receipts.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py index 5cf41501ea..6b0f8c2787 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py @@ -313,10 +313,9 @@ class ReceiptsStore(SQLBaseStore): ) txn.execute(sql, (room_id, receipt_type, user_id)) - results = txn.fetchall() - if results and topological_ordering: - for to, so, _ in results: + if topological_ordering: + for to, so, _ in txn: if int(to) > topological_ordering: return False elif int(to) == topological_ordering and int(so) >= stream_ordering: |