diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-12 14:39:31 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-12 14:39:31 +0000 |
commit | 717687e1fc61a0fa441ff0dee2d49fda518c06bc (patch) | |
tree | e721ed63ff735748706ed1991a72b2126ae009ea /synapse/storage | |
parent | Convert get_rooms to use runInteraction so the transacion has a more helpful ... (diff) | |
download | synapse-717687e1fc61a0fa441ff0dee2d49fda518c06bc.tar.xz |
Get an auth query one at a time
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/event_federation.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py index 0cbcdd1b55..3fbc090224 100644 --- a/synapse/storage/event_federation.py +++ b/synapse/storage/event_federation.py @@ -55,17 +55,16 @@ class EventFederationStore(SQLBaseStore): results = set() base_sql = ( - "SELECT auth_id FROM event_auth WHERE %s" + "SELECT auth_id FROM event_auth WHERE event_id = ?" ) front = set(event_ids) while front: - sql = base_sql % ( - " OR ".join(["event_id=?"] * len(front)), - ) - - txn.execute(sql, list(front)) - front = [r[0] for r in txn.fetchall()] + new_front = set() + for f in front: + txn.execute(base_sql, (f,)) + new_front.update([r[0] for r in txn.fetchall()]) + front = new_front results.update(front) return list(results) |