summary refs log tree commit diff
path: root/synapse/config/workers.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-05-21 15:19:00 +0100
committerErik Johnston <erik@matrix.org>2020-05-21 15:19:00 +0100
commitcf92310da26f9b6e03e98055e55c7e9767225742 (patch)
tree832140c94907ed381004d01f859abbf2fa86dd3b /synapse/config/workers.py
parentMerge branch 'rav/matrix_hacks' into matrix-org-hotfixes (diff)
parentStub out GET presence requests in the frontend proxy (#7545) (diff)
downloadsynapse-cf92310da26f9b6e03e98055e55c7e9767225742.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/config/workers.py')
-rw-r--r--synapse/config/workers.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/synapse/config/workers.py b/synapse/config/workers.py

index fef72ed974..c80c338584 100644 --- a/synapse/config/workers.py +++ b/synapse/config/workers.py
@@ -13,9 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. +import attr + from ._base import Config +@attr.s +class InstanceLocationConfig: + """The host and port to talk to an instance via HTTP replication. + """ + + host = attr.ib(type=str) + port = attr.ib(type=int) + + 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 @@ -71,6 +82,12 @@ class WorkerConfig(Config): elif not bind_addresses: bind_addresses.append("") + # A map from instance name to host/port of their HTTP replication endpoint. + instance_map = config.get("instance_map", {}) or {} + self.instance_map = { + name: InstanceLocationConfig(**c) for name, c in instance_map.items() + } + 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