diff options
author | Erik Johnston <erik@matrix.org> | 2015-06-23 16:41:58 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-06-23 16:41:58 +0100 |
commit | f859e3ca371cdc1cc648a01aa3e665ad3041d09d (patch) | |
tree | 3d963f038459e344922d73b085762d18f534dc1d | |
parent | Remove debug logging (diff) | |
parent | Oops: underride rule had an identifier with override in it. (diff) | |
download | synapse-f859e3ca371cdc1cc648a01aa3e665ad3041d09d.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/persist_event_perf
-rw-r--r-- | synapse/push/baserules.py | 2 | ||||
-rw-r--r-- | synapse/storage/event_federation.py | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index f3d1cf5c5f..1f015a7f2e 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -164,7 +164,7 @@ def make_base_append_underride_rules(user): ] }, { - 'rule_id': 'global/override/.m.rule.contains_display_name', + 'rule_id': 'global/underride/.m.rule.contains_display_name', 'conditions': [ { 'kind': 'contains_display_name' diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py index 40f02e73c9..66271adc1f 100644 --- a/synapse/storage/event_federation.py +++ b/synapse/storage/event_federation.py @@ -49,14 +49,22 @@ class EventFederationStore(SQLBaseStore): results = set() base_sql = ( - "SELECT auth_id FROM event_auth WHERE event_id = ?" + "SELECT auth_id FROM event_auth WHERE event_id IN (%s)" ) front = set(event_ids) while front: new_front = set() - for f in front: - txn.execute(base_sql, (f,)) + front_list = list(front) + chunks = [ + front_list[x:x+100] + for x in xrange(0, len(front), 100) + ] + for chunk in chunks: + txn.execute( + base_sql % (",".join(["?"] * len(chunk)),), + chunk + ) new_front.update([r[0] for r in txn.fetchall()]) new_front -= results |