summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorNick Barrett <nick@beeper.com>2021-11-03 14:25:47 +0000
committerGitHub <noreply@github.com>2021-11-03 14:25:47 +0000
commitaf54167516c7211937efa5b800853f3088ef5178 (patch)
tree6b6cc1144f713b35f42ad776c4bb265948a5d2c1 /synapse/config
parentRemove a debug statement from tests. (#11239) (diff)
downloadsynapse-af54167516c7211937efa5b800853f3088ef5178.tar.xz
Enable passing typing stream writers as a list. (#11237)
This makes the typing stream writer config match the other stream writers
that only currently support a single worker.
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/workers.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/synapse/config/workers.py b/synapse/config/workers.py
index 462630201d..4507992031 100644
--- a/synapse/config/workers.py
+++ b/synapse/config/workers.py
@@ -63,7 +63,8 @@ class WriterLocations:
 
     Attributes:
         events: The instances that write to the event and backfill streams.
-        typing: The instance that writes to the typing stream.
+        typing: The instances that write to the typing stream. Currently
+            can only be a single instance.
         to_device: The instances that write to the to_device stream. Currently
             can only be a single instance.
         account_data: The instances that write to the account data streams. Currently
@@ -75,9 +76,15 @@ class WriterLocations:
     """
 
     events = attr.ib(
-        default=["master"], type=List[str], converter=_instance_to_list_converter
+        default=["master"],
+        type=List[str],
+        converter=_instance_to_list_converter,
+    )
+    typing = attr.ib(
+        default=["master"],
+        type=List[str],
+        converter=_instance_to_list_converter,
     )
-    typing = attr.ib(default="master", type=str)
     to_device = attr.ib(
         default=["master"],
         type=List[str],
@@ -217,6 +224,11 @@ class WorkerConfig(Config):
                         % (instance, stream)
                     )
 
+        if len(self.writers.typing) != 1:
+            raise ConfigError(
+                "Must only specify one instance to handle `typing` messages."
+            )
+
         if len(self.writers.to_device) != 1:
             raise ConfigError(
                 "Must only specify one instance to handle `to_device` messages."