mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:06:08 -04:00
Merge pull request #2309 from matrix-org/erikj/user_ip_repl
Fix up user_ip replication commands
This commit is contained in:
commit
ed9a7f5436
6 changed files with 18 additions and 17 deletions
|
@ -56,9 +56,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue