diff options
author | Erik Johnston <erikj@jki.re> | 2017-06-27 15:36:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-27 15:36:47 +0100 |
commit | 4b444723f00d08ade995e1e757c61b9fc924aaf9 (patch) | |
tree | e5d0fe900254108d653f5d6486d720e4f57d28b5 /synapse/replication/tcp/client.py | |
parent | Merge pull request #2307 from matrix-org/erikj/user_ip_batch (diff) | |
parent | Make workers report to master for user ip updates (diff) | |
download | synapse-4b444723f00d08ade995e1e757c61b9fc924aaf9.tar.xz |
Merge pull request #2308 from matrix-org/erikj/user_ip_repl
Make workers report to master for user ip updates
Diffstat (limited to 'synapse/replication/tcp/client.py')
-rw-r--r-- | synapse/replication/tcp/client.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py index 90fb6c1336..6d2513c4e2 100644 --- a/synapse/replication/tcp/client.py +++ b/synapse/replication/tcp/client.py @@ -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. |