From ea17e939df64370c80316313bea5e50a989476d0 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 23 Mar 2020 18:55:58 +0000 Subject: Add CLEAR_USER_SYNCS command that is sent on shutdown. This should help with the case where a synchrotron gets restarted gracefully, rather than rely on 5 minute timeout. --- synapse/replication/tcp/resource.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'synapse/replication/tcp/resource.py') diff --git a/synapse/replication/tcp/resource.py b/synapse/replication/tcp/resource.py index 8d720694e9..acf8868de9 100644 --- a/synapse/replication/tcp/resource.py +++ b/synapse/replication/tcp/resource.py @@ -254,6 +254,11 @@ class ReplicationStreamer(object): instance_id, user_id, is_syncing, last_sync_ms ) + async def on_clear_user_syncs(self, instance_id): + """A replication client wants us to drop all their UserSync data. + """ + await self.presence_handler.update_external_syncs_clear(instance_id) + @measure_func("repl.on_remove_pusher") async def on_remove_pusher(self, app_id, push_key, user_id): """A client has asked us to remove a pusher -- cgit 1.4.1