Code review

pull/8476/head
Erik Johnston 2020-10-07 09:40:02 +01:00
parent 1a49e23555
commit d22241eced
2 changed files with 9 additions and 1 deletions

View File

@ -686,7 +686,7 @@ class EventCreationHandler:
)
return (
prev_event,
await self.store.get_stream_id_for_event(prev_event.event_id),
prev_event.internal_metadata.stream_ordering,
)
return await self.handle_new_client_event(

View File

@ -285,6 +285,14 @@ class EventsPersistenceStorage:
return event, pos, self.main_store.get_room_max_token()
def _maybe_start_persisting(self, room_id: str):
"""Pokes the `_event_persist_queue` to start handling new items in the
queue, if not already in progress.
Causes the deferreds returned by `add_to_queue` to resolve with: a
dictionary of event ID to event ID we didn't persist as we already had
another event persisted with the same TXN ID.
"""
async def persisting_queue(item):
with Measure(self._clock, "persist_events"):
return await self._persist_events(