diff options
author | Erik Johnston <erik@matrix.org> | 2020-01-17 10:27:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-17 10:27:19 +0000 |
commit | a8a50f5b5746279379b4511c8ecb2a40b143fe32 (patch) | |
tree | 5a195c03f3a7d2c20af9bbcb57d1c77fb3dafc11 /synapse/replication/tcp/resource.py | |
parent | Clarify the `account_validity` and `email` sections of the sample configurati... (diff) | |
download | synapse-a8a50f5b5746279379b4511c8ecb2a40b143fe32.tar.xz |
Wake up transaction queue when remote server comes back online (#6706)
This will be used to retry outbound transactions to a remote server if we think it might have come back up.
Diffstat (limited to 'synapse/replication/tcp/resource.py')
-rw-r--r-- | synapse/replication/tcp/resource.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/replication/tcp/resource.py b/synapse/replication/tcp/resource.py index b1752e88cd..6ebf944f66 100644 --- a/synapse/replication/tcp/resource.py +++ b/synapse/replication/tcp/resource.py @@ -120,6 +120,7 @@ class ReplicationStreamer(object): self.federation_sender = hs.get_federation_sender() self.notifier.add_replication_callback(self.on_notifier_poke) + self.notifier.add_remote_server_up_callback(self.send_remote_server_up) # Keeps track of whether we are currently checking for updates self.is_looping = False @@ -288,6 +289,14 @@ class ReplicationStreamer(object): ) await self._server_notices_sender.on_user_ip(user_id) + @measure_func("repl.on_remote_server_up") + def on_remote_server_up(self, server: str): + self.notifier.notify_remote_server_up(server) + + def send_remote_server_up(self, server: str): + for conn in self.connections: + conn.send_remote_server_up(server) + def send_sync_to_all_connections(self, data): """Sends a SYNC command to all clients. |