summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-03-21 18:03:08 +0000
committerMark Haines <mark.haines@matrix.org>2016-03-21 18:06:08 +0000
commit5244c0b48ebb86273bbb79a1935cf5893aa6f310 (patch)
tree7844c760fe9b76f2db4a9e52d6b6f589d3e21bfe /synapse/storage
parentremove unused current_state variable from on_receive_pdu (diff)
downloadsynapse-5244c0b48ebb86273bbb79a1935cf5893aa6f310.tar.xz
Remove unused backfilled parameter from persist_event
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events.py22
1 files changed, 4 insertions, 18 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 285c586cfe..e444b64cee 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -101,30 +101,16 @@ class EventsStore(SQLBaseStore):
 
     @defer.inlineCallbacks
     @log_function
-    def persist_event(self, event, context, backfilled=False,
+    def persist_event(self, event, context,
                       is_new_state=True, current_state=None):
-        stream_ordering = None
-        if backfilled:
-            self.min_stream_token -= 1
-            stream_ordering = self.min_stream_token
-
-        if stream_ordering is None:
-            stream_ordering_manager = self._stream_id_gen.get_next()
-        else:
-            @contextmanager
-            def stream_ordering_manager():
-                yield stream_ordering
-            stream_ordering_manager = stream_ordering_manager()
-
         try:
-            with stream_ordering_manager as stream_ordering:
+            with self._stream_id_gen.get_next() as stream_ordering:
                 event.internal_metadata.stream_ordering = stream_ordering
                 yield self.runInteraction(
                     "persist_event",
                     self._persist_event_txn,
                     event=event,
                     context=context,
-                    backfilled=backfilled,
                     is_new_state=is_new_state,
                     current_state=current_state,
                 )
@@ -166,7 +152,7 @@ class EventsStore(SQLBaseStore):
         defer.returnValue(events[0] if events else None)
 
     @log_function
-    def _persist_event_txn(self, txn, event, context, backfilled,
+    def _persist_event_txn(self, txn, event, context,
                            is_new_state=True, current_state=None):
         # We purposefully do this first since if we include a `current_state`
         # key, we *want* to update the `current_state_events` table
@@ -198,7 +184,7 @@ class EventsStore(SQLBaseStore):
         return self._persist_events_txn(
             txn,
             [(event, context)],
-            backfilled=backfilled,
+            backfilled=False,
             is_new_state=is_new_state,
         )