mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-09-20 19:34:34 -04:00
Refactor and convert Linearizer
to async (#12357)
Refactor and convert `Linearizer` to async. This makes a `Linearizer` cancellation bug easier to fix. Also refactor to use an async context manager, which eliminates an unlikely footgun where code that doesn't immediately use the context manager could forget to release the lock. Signed-off-by: Sean Quah <seanq@element.io>
This commit is contained in:
parent
ab3fdcf960
commit
800ba87cc8
21 changed files with 104 additions and 115 deletions
|
@ -430,7 +430,7 @@ class SsoHandler:
|
|||
# grab a lock while we try to find a mapping for this user. This seems...
|
||||
# optimistic, especially for implementations that end up redirecting to
|
||||
# interstitial pages.
|
||||
with await self._mapping_lock.queue(auth_provider_id):
|
||||
async with self._mapping_lock.queue(auth_provider_id):
|
||||
# first of all, check if we already have a mapping for this user
|
||||
user_id = await self.get_sso_user_by_remote_user_id(
|
||||
auth_provider_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue