mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 16:21:00 -05:00
Rename get_tcp_replication to get_replication_command_handler. (#12192)
Since the object it returns is a ReplicationCommandHandler. This is clean-up from adding support to Redis where the command handler was added as an additional layer of abstraction from the TCP protocol.
This commit is contained in:
parent
a4c1fdb44a
commit
3e4af36bc8
15 changed files with 20 additions and 19 deletions
|
|
@ -462,6 +462,8 @@ class FederationSenderHandler:
|
|||
|
||||
# We ACK this token over replication so that the master can drop
|
||||
# its in memory queues
|
||||
self._hs.get_tcp_replication().send_federation_ack(current_position)
|
||||
self._hs.get_replication_command_handler().send_federation_ack(
|
||||
current_position
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("Error updating federation stream position")
|
||||
|
|
|
|||
|
|
@ -295,9 +295,7 @@ class ReplicationCommandHandler:
|
|||
raise Exception("Unrecognised command %s in stream queue", cmd.NAME)
|
||||
|
||||
def start_replication(self, hs: "HomeServer") -> None:
|
||||
"""Helper method to start a replication connection to the remote server
|
||||
using TCP.
|
||||
"""
|
||||
"""Helper method to start replication."""
|
||||
if hs.config.redis.redis_enabled:
|
||||
from synapse.replication.tcp.redis import (
|
||||
RedisDirectTcpReplicationClientFactory,
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ class RedisDirectTcpReplicationClientFactory(SynapseRedisFactory):
|
|||
password=hs.config.redis.redis_password,
|
||||
)
|
||||
|
||||
self.synapse_handler = hs.get_tcp_replication()
|
||||
self.synapse_handler = hs.get_replication_command_handler()
|
||||
self.synapse_stream_name = hs.hostname
|
||||
|
||||
self.synapse_outbound_redis_connection = outbound_redis_connection
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class ReplicationStreamProtocolFactory(ServerFactory):
|
|||
"""Factory for new replication connections."""
|
||||
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.command_handler = hs.get_tcp_replication()
|
||||
self.command_handler = hs.get_replication_command_handler()
|
||||
self.clock = hs.get_clock()
|
||||
self.server_name = hs.config.server.server_name
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ class ReplicationStreamer:
|
|||
self.is_looping = False
|
||||
self.pending_updates = False
|
||||
|
||||
self.command_handler = hs.get_tcp_replication()
|
||||
self.command_handler = hs.get_replication_command_handler()
|
||||
|
||||
# Set of streams to replicate.
|
||||
self.streams = self.command_handler.get_streams_to_replicate()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue