summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-03-06 19:17:39 +0000
committerGitHub <noreply@github.com>2019-03-06 19:17:39 +0000
commit1f85c2c0ce4ff6c79645669b359be4243107ee21 (patch)
tree606575052fe23fb84276e405e7cd66bd523e1275
parentMerge pull request #4815 from matrix-org/erikj/docstrings (diff)
parentUpdate changelog (diff)
downloadsynapse-1f85c2c0ce4ff6c79645669b359be4243107ee21.tar.xz
Merge pull request #4818 from matrix-org/erikj/prefill_client_ips
Prefill client IPs cache on workers
-rw-r--r--changelog.d/4818.bugfix1
-rw-r--r--synapse/replication/slave/storage/client_ips.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/changelog.d/4818.bugfix b/changelog.d/4818.bugfix
new file mode 100644
index 0000000000..ebbc27a433
--- /dev/null
+++ b/changelog.d/4818.bugfix
@@ -0,0 +1 @@
+Fix bug where we didn't correctly throttle sending of USER_IP commands over replication.
diff --git a/synapse/replication/slave/storage/client_ips.py b/synapse/replication/slave/storage/client_ips.py
index 60641f1a49..5b8521c770 100644
--- a/synapse/replication/slave/storage/client_ips.py
+++ b/synapse/replication/slave/storage/client_ips.py
@@ -43,6 +43,8 @@ class SlavedClientIpStore(BaseSlavedStore):
         if last_seen is not None and (now - last_seen) < LAST_SEEN_GRANULARITY:
             return
 
+        self.client_ip_last_seen.prefill(key, now)
+
         self.hs.get_tcp_replication().send_user_ip(
             user_id, access_token, ip, user_agent, device_id, now
         )