diff options
author | Olivier Wilkinson (reivilibre) <oliverw@matrix.org> | 2021-11-04 13:38:46 +0000 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <oliverw@matrix.org> | 2021-11-04 13:38:46 +0000 |
commit | e38f7953ef62c990ec525f2819e1ad8d8ae3dbdf (patch) | |
tree | 4eeec5fe16c5b41dd33a3c42f553bbbef26c511e /synapse/config/workers.py | |
parent | Simplify gatherResults and fix log contexts (diff) | |
parent | Track ongoing event fetches correctly in the presence of failure (#11240) (diff) | |
download | synapse-e38f7953ef62c990ec525f2819e1ad8d8ae3dbdf.tar.xz |
Merge branch 'develop' into rei/gsfg_1
Diffstat (limited to 'synapse/config/workers.py')
-rw-r--r-- | synapse/config/workers.py | 18 |
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." |