diff options
author | Nick Barrett <nick@beeper.com> | 2021-11-03 14:25:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-03 14:25:47 +0000 |
commit | af54167516c7211937efa5b800853f3088ef5178 (patch) | |
tree | 6b6cc1144f713b35f42ad776c4bb265948a5d2c1 /synapse/replication | |
parent | Remove a debug statement from tests. (#11239) (diff) | |
download | synapse-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/replication')
-rw-r--r-- | synapse/replication/tcp/handler.py | 2 | ||||
-rw-r--r-- | synapse/replication/tcp/streams/_base.py | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/synapse/replication/tcp/handler.py b/synapse/replication/tcp/handler.py index 06fd06fdf3..21293038ef 100644 --- a/synapse/replication/tcp/handler.py +++ b/synapse/replication/tcp/handler.py @@ -138,7 +138,7 @@ class ReplicationCommandHandler: if isinstance(stream, TypingStream): # Only add TypingStream as a source on the instance in charge of # typing. - if hs.config.worker.writers.typing == hs.get_instance_name(): + if hs.get_instance_name() in hs.config.worker.writers.typing: self._streams_to_replicate.append(stream) continue diff --git a/synapse/replication/tcp/streams/_base.py b/synapse/replication/tcp/streams/_base.py index c8b188ae4e..743a01da08 100644 --- a/synapse/replication/tcp/streams/_base.py +++ b/synapse/replication/tcp/streams/_base.py @@ -328,8 +328,7 @@ class TypingStream(Stream): ROW_TYPE = TypingStreamRow def __init__(self, hs: "HomeServer"): - writer_instance = hs.config.worker.writers.typing - if writer_instance == hs.get_instance_name(): + if hs.get_instance_name() in hs.config.worker.writers.typing: # On the writer, query the typing handler typing_writer_handler = hs.get_typing_writer_handler() update_function: Callable[ |