summary refs log tree commit diff
path: root/synapse/replication/tcp/streams.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-04-04 15:40:51 +0100
committerGitHub <noreply@github.com>2017-04-04 15:40:51 +0100
commita76886726bbe68bcc7781ebb457cb1dc728efc4e (patch)
tree4682c31a49aa26abbbeebf7088e3bba3316c8a86 /synapse/replication/tcp/streams.py
parentFiddle tcp replication logging (diff)
parentAdvance replication streams even if nothing is listening (diff)
downloadsynapse-a76886726bbe68bcc7781ebb457cb1dc728efc4e.tar.xz
Merge pull request #2098 from matrix-org/erikj/repl_tcp_fix
Advance replication streams even if nothing is listening
Diffstat (limited to 'synapse/replication/tcp/streams.py')
-rw-r--r--synapse/replication/tcp/streams.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/replication/tcp/streams.py b/synapse/replication/tcp/streams.py
index fada40c6ef..4de4ebe84d 100644
--- a/synapse/replication/tcp/streams.py
+++ b/synapse/replication/tcp/streams.py
@@ -89,6 +89,13 @@ class Stream(object):
         """
         self.upto_token = self.current_token()
 
+    def discard_updates_and_advance(self):
+        """Called when the stream should advance but the updates would be discarded,
+        e.g. when there are no currently connected workers.
+        """
+        self.upto_token = self.current_token()
+        self.last_token = self.upto_token
+
     @defer.inlineCallbacks
     def get_updates(self):
         """Gets all updates since the last time this function was called (or