diff options
author | Erik Johnston <erik@matrix.org> | 2020-03-23 18:40:03 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2020-03-23 18:52:24 +0000 |
commit | 225b993cf6d3a24e3f7e0d0be28b663e4157c53d (patch) | |
tree | 95a8cd374497bb19c53db16a5bc67b56f68840e9 /synapse/app/generic_worker.py | |
parent | Handle connection closing under us (diff) | |
download | synapse-225b993cf6d3a24e3f7e0d0be28b663e4157c53d.tar.xz |
Remove `conn_id` usage for UserSyncCommand.
Each tcp replication connection is assigned a "conn_id", which is used to give an ID to a remotely connected worker. In a redis world, there will no longer be a one to one mapping between connection and instance, so instead we need to replace such usages with an ID generated by the remote instances and included in the replicaiton commands. This really only effects UserSyncCommand.
Diffstat (limited to 'synapse/app/generic_worker.py')
-rw-r--r-- | synapse/app/generic_worker.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py index 5a011eac90..cc0bcd126a 100644 --- a/synapse/app/generic_worker.py +++ b/synapse/app/generic_worker.py @@ -233,6 +233,7 @@ class GenericWorkerPresence(object): self.user_to_num_current_syncs = {} self.clock = hs.get_clock() self.notifier = hs.get_notifier() + self.instance_id = hs.get_instance_id() active_presence = self.store.take_presence_startup_info() self.user_to_current_state = {state.user_id: state for state in active_presence} @@ -251,7 +252,7 @@ class GenericWorkerPresence(object): def send_user_sync(self, user_id, is_syncing, last_sync_ms): if self.hs.config.use_presence: self.hs.get_tcp_replication().send_user_sync( - user_id, is_syncing, last_sync_ms + self.instance_id, user_id, is_syncing, last_sync_ms ) def mark_as_coming_online(self, user_id): |