From 7b2af21b93042d09ab59ec365aee8e9eeef2791f Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 6 Apr 2020 15:38:18 +0100 Subject: [PATCH] s/self.client/self.command_handler/ --- synapse/replication/tcp/resource.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/synapse/replication/tcp/resource.py b/synapse/replication/tcp/resource.py index 4764f3b121..5b0eaf4d2b 100644 --- a/synapse/replication/tcp/resource.py +++ b/synapse/replication/tcp/resource.py @@ -93,7 +93,7 @@ class ReplicationStreamer(object): self.is_looping = False self.pending_updates = False - self.client = hs.get_tcp_replication() + self.command_handler = hs.get_tcp_replication() def get_streams(self) -> Dict[str, Stream]: """Get a mapp from stream name to stream instance. @@ -107,7 +107,7 @@ class ReplicationStreamer(object): This should get called each time new data is available, even if it is currently being executed, so that nothing gets missed """ - if not self.client.connected(): + if not self.command_handler.connected(): # Don't bother if nothing is listening. We still need to advance # the stream tokens otherwise they'll fall beihind forever for stream in self.streams: @@ -182,7 +182,9 @@ class ReplicationStreamer(object): for token, row in batched_updates: try: - self.client.stream_update(stream.NAME, token, row) + self.command_handler.stream_update( + stream.NAME, token, row + ) except Exception: logger.exception("Failed to replicate")