From 96b6023e3bfc4b6233a038fe38f0c9802f131b69 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 30 Apr 2020 17:58:18 +0100 Subject: Make location of events writer configurable --- synapse/config/workers.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/synapse/config/workers.py b/synapse/config/workers.py index c80c338584..a4cd4d3066 100644 --- a/synapse/config/workers.py +++ b/synapse/config/workers.py @@ -27,6 +27,17 @@ class InstanceLocationConfig: port = attr.ib(type=int) +@attr.s +class WriterLocations: + """Specifies the instances that write various streams. + + Attributes: + events: The instance that writes to the event and backfill streams. + """ + + events = attr.ib(default="master", type=str) + + class WorkerConfig(Config): """The workers are processes run separately to the main synapse process. They have their own pid_file and listener configuration. They use the @@ -88,6 +99,10 @@ class WorkerConfig(Config): name: InstanceLocationConfig(**c) for name, c in instance_map.items() } + # Map from type of streams to source, c.f. WriterLocations. + writers = config.get("writers", {}) or {} + self.writers = WriterLocations(**writers) + def read_arguments(self, args): # We support a bunch of command line arguments that override options in # the config. A lot of these options have a worker_* prefix when running -- cgit 1.5.1