diff options
author | Erik Johnston <erik@matrix.org> | 2020-02-19 13:56:15 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2020-02-19 13:56:15 +0000 |
commit | 008aaca0b6f12a6ff5609ba081a4ec8e854486f9 (patch) | |
tree | 4d308fe1c2717a3e35aacd30b62d92968dd2e149 | |
parent | Revert `get_auth_chain_ids` changes (#6951) (diff) | |
download | synapse-008aaca0b6f12a6ff5609ba081a4ec8e854486f9.tar.xz |
Minor perf fixes to `get_auth_chain_ids`
-rw-r--r-- | synapse/storage/data_stores/main/event_federation.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/data_stores/main/event_federation.py b/synapse/storage/data_stores/main/event_federation.py index 60c67457b4..6edebd7d18 100644 --- a/synapse/storage/data_stores/main/event_federation.py +++ b/synapse/storage/data_stores/main/event_federation.py @@ -72,13 +72,13 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas while front: new_front = set() front_list = list(front) - chunks = [front_list[x : x + 100] for x in range(0, len(front), 100)] + chunks = (front_list[x : x + 100] for x in range(0, len(front), 100)) for chunk in chunks: clause, args = make_in_list_sql_clause( txn.database_engine, "event_id", chunk ) - txn.execute(base_sql + clause, list(args)) - new_front.update([r[0] for r in txn]) + txn.execute(base_sql + clause, args) + new_front.update(r[0] for r in txn) new_front -= results |