Add support for moving `/push_rules` off of main process (#17037)
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/config/workers.py b/synapse/config/workers.py
index e9c67807e5..9f81a73d6f 100644
--- a/synapse/config/workers.py
+++ b/synapse/config/workers.py
@@ -156,6 +156,8 @@ class WriterLocations:
can only be a single instance.
presence: The instances that write to the presence stream. Currently
can only be a single instance.
+ push: The instances that write to the push stream. Currently
+ can only be a single instance.
"""
events: List[str] = attr.ib(
@@ -182,6 +184,10 @@ class WriterLocations:
default=["master"],
converter=_instance_to_list_converter,
)
+ push: List[str] = attr.ib(
+ default=["master"],
+ converter=_instance_to_list_converter,
+ )
@attr.s(auto_attribs=True)
@@ -341,6 +347,7 @@ class WorkerConfig(Config):
"account_data",
"receipts",
"presence",
+ "push",
):
instances = _instance_to_list_converter(getattr(self.writers, stream))
for instance in instances:
@@ -378,6 +385,11 @@ class WorkerConfig(Config):
"Must only specify one instance to handle `presence` messages."
)
+ if len(self.writers.push) != 1:
+ raise ConfigError(
+ "Must only specify one instance to handle `push` messages."
+ )
+
self.events_shard_config = RoutableShardedWorkerHandlingConfig(
self.writers.events
)
|