mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:06:05 -04:00
Stop the master relaying USER_SYNC for other workers (#7318)
Long story short: if we're handling presence on the current worker, we shouldn't be sending USER_SYNC commands over replication. In an attempt to figure out what is going on here, I ended up refactoring some bits of the presencehandler code, so the first 4 commits here are non-functional refactors to move this code slightly closer to sanity. (There's still plenty to do here :/). Suggest reviewing individual commits. Fixes (I hope) #7257.
This commit is contained in:
parent
841c581c40
commit
71a1abb8a1
10 changed files with 199 additions and 159 deletions
|
@ -210,7 +210,10 @@ class ReplicateCommand(Command):
|
|||
|
||||
class UserSyncCommand(Command):
|
||||
"""Sent by the client to inform the server that a user has started or
|
||||
stopped syncing. Used to calculate presence on the master.
|
||||
stopped syncing on this process.
|
||||
|
||||
This is used by the process handling presence (typically the master) to
|
||||
calculate who is online and who is not.
|
||||
|
||||
Includes a timestamp of when the last user sync was.
|
||||
|
||||
|
@ -218,7 +221,7 @@ class UserSyncCommand(Command):
|
|||
|
||||
USER_SYNC <instance_id> <user_id> <state> <last_sync_ms>
|
||||
|
||||
Where <state> is either "start" or "stop"
|
||||
Where <state> is either "start" or "end"
|
||||
"""
|
||||
|
||||
NAME = "USER_SYNC"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue