mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:06:05 -04:00
Allow running sendToDevice on workers (#9044)
This commit is contained in:
parent
5e99a94502
commit
b530eaa262
11 changed files with 231 additions and 105 deletions
|
@ -56,6 +56,7 @@ from synapse.replication.tcp.streams import (
|
|||
EventsStream,
|
||||
FederationStream,
|
||||
Stream,
|
||||
ToDeviceStream,
|
||||
TypingStream,
|
||||
)
|
||||
|
||||
|
@ -115,6 +116,14 @@ class ReplicationCommandHandler:
|
|||
|
||||
continue
|
||||
|
||||
if isinstance(stream, ToDeviceStream):
|
||||
# Only add ToDeviceStream as a source on instances in charge of
|
||||
# sending to device messages.
|
||||
if hs.get_instance_name() in hs.config.worker.writers.to_device:
|
||||
self._streams_to_replicate.append(stream)
|
||||
|
||||
continue
|
||||
|
||||
if isinstance(stream, TypingStream):
|
||||
# Only add TypingStream as a source on the instance in charge of
|
||||
# typing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue