mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-16 03:23:51 -05:00
Simplification to Keyring.wait_for_previous_lookups. (#5250)
The list of server names was redundant, since it was equivalent to the keys on the server_to_deferred map. This reduces the number of large lists being passed around, and has the benefit of deduplicating the entries in `wait_on`.
This commit is contained in:
parent
dd64b9dbdd
commit
fa1b293da2
3 changed files with 7 additions and 9 deletions
|
|
@ -85,7 +85,7 @@ class KeyringTestCase(unittest.HomeserverTestCase):
|
|||
# we run the lookup in a logcontext so that the patched inlineCallbacks can check
|
||||
# it is doing the right thing with logcontexts.
|
||||
wait_1_deferred = run_in_context(
|
||||
kr.wait_for_previous_lookups, ["server1"], {"server1": lookup_1_deferred}
|
||||
kr.wait_for_previous_lookups, {"server1": lookup_1_deferred}
|
||||
)
|
||||
|
||||
# there were no previous lookups, so the deferred should be ready
|
||||
|
|
@ -94,7 +94,7 @@ class KeyringTestCase(unittest.HomeserverTestCase):
|
|||
# set off another wait. It should block because the first lookup
|
||||
# hasn't yet completed.
|
||||
wait_2_deferred = run_in_context(
|
||||
kr.wait_for_previous_lookups, ["server1"], {"server1": lookup_2_deferred}
|
||||
kr.wait_for_previous_lookups, {"server1": lookup_2_deferred}
|
||||
)
|
||||
|
||||
self.assertFalse(wait_2_deferred.called)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue