summary refs log tree commit diff
path: root/synapse/storage/persist_events.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-30 13:33:38 +0000
committerErik Johnston <erik@matrix.org>2019-10-30 13:36:12 +0000
commita8d16f6c00d5adb204af5fa73ffaea40eea4b632 (patch)
tree0a4d7f5c507fe7968bc067548687bd7917967df8 /synapse/storage/persist_events.py
parentNewsfile (diff)
downloadsynapse-a8d16f6c00d5adb204af5fa73ffaea40eea4b632.tar.xz
Review comments
Diffstat (limited to 'synapse/storage/persist_events.py')
-rw-r--r--synapse/storage/persist_events.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/storage/persist_events.py b/synapse/storage/persist_events.py
index 9a63953d4d..cf66225574 100644
--- a/synapse/storage/persist_events.py
+++ b/synapse/storage/persist_events.py
@@ -171,7 +171,13 @@ class _EventPeristenceQueue(object):
             pass
 
 
-class EventsPersistenceStore(object):
+class EventsPersistenceStorage(object):
+    """High level interface for handling persisting newly received events.
+
+    Takes care of batching up events by room, and calculating the necessary
+    current state and forward extremity changes.
+    """
+
     def __init__(self, hs, stores: DataStores):
         # We ultimately want to split out the state store from the main store,
         # so we use separate variables here even though they point to the same
@@ -257,7 +263,8 @@ class EventsPersistenceStore(object):
     def _persist_events(
         self, events_and_contexts, backfilled=False, delete_existing=False
     ):
-        """Persist events to db
+        """Calculates the change to current state and forward extremities, and
+        persists the given events and with those updates.
 
         Args:
             events_and_contexts (list[(EventBase, EventContext)]):
@@ -399,7 +406,7 @@ class EventsPersistenceStore(object):
                         if current_state is not None:
                             current_state_for_room[room_id] = current_state
 
-            yield self.main_store._persist_events(
+            yield self.main_store._persist_events_and_state_updates(
                 chunk,
                 current_state_for_room=current_state_for_room,
                 state_delta_for_room=state_delta_for_room,