Don't parallelise persist_events
parent
9951f43764
commit
3cf2203c5c
|
@ -76,9 +76,9 @@ class EventsStore(SQLBaseStore):
|
||||||
for x in xrange(0, len(events_and_contexts), 100)
|
for x in xrange(0, len(events_and_contexts), 100)
|
||||||
]
|
]
|
||||||
|
|
||||||
if is_new_state:
|
|
||||||
# If is_new_state then we have to do chunks in order
|
|
||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
|
# We can't easily parallelize these since different chunks
|
||||||
|
# might contain the same event. :()
|
||||||
yield self.runInteraction(
|
yield self.runInteraction(
|
||||||
"persist_events",
|
"persist_events",
|
||||||
self._persist_events_txn,
|
self._persist_events_txn,
|
||||||
|
@ -86,21 +86,6 @@ class EventsStore(SQLBaseStore):
|
||||||
backfilled=backfilled,
|
backfilled=backfilled,
|
||||||
is_new_state=is_new_state,
|
is_new_state=is_new_state,
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
# Otherwise, do them sequentially
|
|
||||||
yield defer.gatherResults(
|
|
||||||
[
|
|
||||||
self.runInteraction(
|
|
||||||
"persist_events",
|
|
||||||
self._persist_events_txn,
|
|
||||||
events_and_contexts=chunk,
|
|
||||||
backfilled=backfilled,
|
|
||||||
is_new_state=is_new_state,
|
|
||||||
)
|
|
||||||
for chunk in chunks
|
|
||||||
],
|
|
||||||
consumeErrors=True,
|
|
||||||
).addErrback(unwrapFirstError)
|
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
@log_function
|
@log_function
|
||||||
|
|
Loading…
Reference in New Issue