summary refs log tree commit diff
path: root/synapse/replication/tcp
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2022-02-11 12:42:03 -0500
committerPatrick Cloke <patrickc@matrix.org>2023-03-15 14:31:26 -0400
commit6a639cbc08ea6a1ac55512a674b0b035ad4f5483 (patch)
treea3f5bd99bfac9ffc32fee5a12515d851b3ae9542 /synapse/replication/tcp
parentEnable running tests & release artifacts on merge queue. (#15244) (diff)
downloadsynapse-6a639cbc08ea6a1ac55512a674b0b035ad4f5483.tar.xz
Require redis be enabled for workers.
Diffstat (limited to 'synapse/replication/tcp')
-rw-r--r--synapse/replication/tcp/handler.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/synapse/replication/tcp/handler.py b/synapse/replication/tcp/handler.py

index d03a53d764..551aa45845 100644 --- a/synapse/replication/tcp/handler.py +++ b/synapse/replication/tcp/handler.py
@@ -114,9 +114,8 @@ class ReplicationCommandHandler: self._streams_to_replicate: List[Stream] = [] for stream in self._streams.values(): - if hs.config.redis.redis_enabled and stream.NAME == CachesStream.NAME: - # All workers can write to the cache invalidation stream when - # using redis. + if stream.NAME == CachesStream.NAME: + # All workers can write to the cache invalidation stream. self._streams_to_replicate.append(stream) continue @@ -236,14 +235,9 @@ class ReplicationCommandHandler: if self._is_master: self._server_notices_sender = hs.get_server_notices_sender() - if hs.config.redis.redis_enabled: - # If we're using Redis, it's the background worker that should - # receive USER_IP commands and store the relevant client IPs. - self._should_insert_client_ips = hs.config.worker.run_background_tasks - else: - # If we're NOT using Redis, this must be handled by the master - self._should_insert_client_ips = hs.get_instance_name() == "master" - + # The worker assigned background tasks should handle client IPs. + # receive USER_IP commands and store the relevant client IPs. + self._should_insert_client_ips = hs.config.worker.run_background_tasks if self._is_master or self._should_insert_client_ips: self.subscribe_to_channel("USER_IP")