diff options
author | Erik Johnston <erikj@jki.re> | 2017-04-04 10:07:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-04 10:07:57 +0100 |
commit | 27cc627e425a4a1d6baf3887b435005a571c2271 (patch) | |
tree | a5fa797ac7e65f85cae52cccd88451e5672257c6 /synapse/app | |
parent | Merge pull request #2095 from matrix-org/rav/cull_log_preserves (diff) | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/repl_tcp_s... (diff) | |
download | synapse-27cc627e425a4a1d6baf3887b435005a571c2271.tar.xz |
Merge pull request #2082 from matrix-org/erikj/repl_tcp_server
Replace HTTP replication with TCP replication (Server side part)
Diffstat (limited to 'synapse/app')
-rwxr-xr-x | synapse/app/homeserver.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 2cdd2d39ff..990eb477e5 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -56,6 +56,7 @@ from synapse.util.logcontext import LoggingContext, PreserveLoggingContext from synapse.metrics import register_memory_metrics, get_metrics_for from synapse.metrics.resource import MetricsResource, METRICS_PREFIX from synapse.replication.resource import ReplicationResource, REPLICATION_PREFIX +from synapse.replication.tcp.resource import ReplicationStreamProtocolFactory from synapse.federation.transport.server import TransportLayerServer from synapse.util.rlimit import change_resource_limit @@ -222,6 +223,16 @@ class SynapseHomeServer(HomeServer): ), interface=address ) + elif listener["type"] == "replication": + bind_addresses = listener["bind_addresses"] + for address in bind_addresses: + factory = ReplicationStreamProtocolFactory(self) + server_listener = reactor.listenTCP( + listener["port"], factory, interface=address + ) + reactor.addSystemEventTrigger( + "before", "shutdown", server_listener.stopListening, + ) else: logger.warn("Unrecognized listener type: %s", listener["type"]) |