mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-24 13:28:29 -04:00
Don't lock user_ips table for upsert.
This commit is contained in:
parent
fabb7acd45
commit
657298cebd
2 changed files with 10 additions and 4 deletions
|
@ -104,6 +104,8 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||
|
||||
self.client_ip_last_seen.prefill(*key + (now,))
|
||||
|
||||
# It's safe not to lock here: a) no unique constraint,
|
||||
# b) LAST_SEEN_GRANULARITY makes concurrent updates incredibly unlikely
|
||||
yield self._simple_upsert(
|
||||
"user_ips",
|
||||
keyvalues={
|
||||
|
@ -117,6 +119,7 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||
"last_seen": now,
|
||||
},
|
||||
desc="insert_client_ip",
|
||||
lock=False,
|
||||
)
|
||||
|
||||
def get_user_ip_and_agents(self, user):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue