mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:46:02 -04:00
Advance replication streams even if nothing is listening
Otherwise the streams don't advance and steadily fall behind, so when a worker does connect either a) they'll be streamed lots of old updates or b) the connection will fail as the streams are too far behind.
This commit is contained in:
parent
27cc627e42
commit
023ee197be
3 changed files with 15 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue