summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-06-27 15:53:45 +0100
committerErik Johnston <erik@matrix.org>2017-06-27 15:53:45 +0100
commit8c23221666f1a09fdc97c2b526cb100cdbd32f60 (patch)
tree89cb4b139527f59388026987204e66b878bab931 /synapse/storage
parentMake workers report to master for user ip updates (diff)
downloadsynapse-8c23221666f1a09fdc97c2b526cb100cdbd32f60.tar.xz
Fix up
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/client_ips.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/storage/client_ips.py b/synapse/storage/client_ips.py
index 88a5eb232f..5a88e242e5 100644
--- a/synapse/storage/client_ips.py
+++ b/synapse/storage/client_ips.py
@@ -58,9 +58,11 @@ class ClientIpStore(background_updates.BackgroundUpdateStore):
         )
         reactor.addSystemEventTrigger("before", "shutdown", self._update_client_ips_batch)
 
-    def insert_client_ip(self, user, access_token, ip, user_agent, device_id):
-        now = int(self._clock.time_msec())
-        key = (user.to_string(), access_token, ip)
+    def insert_client_ip(self, user_id, access_token, ip, user_agent, device_id,
+                         now=None):
+        if not now:
+            now = int(self._clock.time_msec())
+        key = (user_id, access_token, ip)
 
         try:
             last_seen = self.client_ip_last_seen.get(key)