Merge branch 'develop' of github.com:matrix-org/synapse into erikj/persist_event_perf
This commit is contained in:
commit
f859e3ca37
|
@ -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': [
|
'conditions': [
|
||||||
{
|
{
|
||||||
'kind': 'contains_display_name'
|
'kind': 'contains_display_name'
|
||||||
|
|
|
@ -49,14 +49,22 @@ class EventFederationStore(SQLBaseStore):
|
||||||
results = set()
|
results = set()
|
||||||
|
|
||||||
base_sql = (
|
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)
|
front = set(event_ids)
|
||||||
while front:
|
while front:
|
||||||
new_front = set()
|
new_front = set()
|
||||||
for f in front:
|
front_list = list(front)
|
||||||
txn.execute(base_sql, (f,))
|
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.update([r[0] for r in txn.fetchall()])
|
||||||
|
|
||||||
new_front -= results
|
new_front -= results
|
||||||
|
|
Loading…
Reference in New Issue