mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-31 16:28:35 -04:00
fix race condiftion in calling initialise_reserved_users
This commit is contained in:
parent
7aea00069c
commit
6105c6101f
5 changed files with 55 additions and 27 deletions
|
@ -474,17 +474,25 @@ class RegistrationStore(RegistrationWorkerStore,
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def get_user_id_by_threepid(self, medium, address):
|
||||
ret = yield self._simple_select_one(
|
||||
user_id = yield self.runInteraction(
|
||||
"get_user_id_by_threepid", self.get_user_id_by_threepid_txn,
|
||||
medium, address
|
||||
)
|
||||
defer.returnValue(user_id)
|
||||
|
||||
def get_user_id_by_threepid_txn(self, txn, medium, address):
|
||||
ret = self._simple_select_one_txn(
|
||||
txn,
|
||||
"user_threepids",
|
||||
{
|
||||
"medium": medium,
|
||||
"address": address
|
||||
},
|
||||
['user_id'], True, 'get_user_id_by_threepid'
|
||||
['user_id'], True
|
||||
)
|
||||
if ret:
|
||||
defer.returnValue(ret['user_id'])
|
||||
defer.returnValue(None)
|
||||
return ret['user_id']
|
||||
return None
|
||||
|
||||
def user_delete_threepid(self, user_id, medium, address):
|
||||
return self._simple_delete(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue