mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-17 07:39:11 -04:00
Make workers report to master for user ip updates
This commit is contained in:
parent
a0a561ae85
commit
78cefd78d6
9 changed files with 111 additions and 8 deletions
|
@ -20,6 +20,7 @@ from twisted.internet.protocol import ReconnectingClientFactory
|
|||
|
||||
from .commands import (
|
||||
FederationAckCommand, UserSyncCommand, RemovePusherCommand, InvalidateCacheCommand,
|
||||
UserIpCommand,
|
||||
)
|
||||
from .protocol import ClientReplicationStreamProtocol
|
||||
|
||||
|
@ -178,6 +179,12 @@ class ReplicationClientHandler(object):
|
|||
cmd = InvalidateCacheCommand(cache_func.__name__, keys)
|
||||
self.send_command(cmd)
|
||||
|
||||
def send_user_ip(self, user_id, access_token, ip, user_agent, device_id, last_seen):
|
||||
"""Tell the master that the user made a request.
|
||||
"""
|
||||
cmd = UserIpCommand(user_id, access_token, ip, user_agent, device_id, last_seen)
|
||||
self.send_command(cmd)
|
||||
|
||||
def await_sync(self, data):
|
||||
"""Returns a deferred that is resolved when we receive a SYNC command
|
||||
with given data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue