diff options
author | Richard van der Hoff <richard@matrix.org> | 2017-09-20 01:32:42 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2017-09-20 01:32:42 +0100 |
commit | afbd773dc66d43d066d5a0b4639075a2d09cb4e5 (patch) | |
tree | 80228c92d62350410f6d79ecd1f1ddc6d791af37 | |
parent | Consistency for how verify_request.deferred is called (diff) | |
download | synapse-afbd773dc66d43d066d5a0b4639075a2d09cb4e5.tar.xz |
Add some comments to _start_key_lookups
Diffstat (limited to '')
-rw-r--r-- | synapse/crypto/keyring.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py index 22bb325cfd..d7fd831bf9 100644 --- a/synapse/crypto/keyring.py +++ b/synapse/crypto/keyring.py @@ -140,6 +140,12 @@ class Keyring(object): Args: verify_requests (List[VerifyKeyRequest]): """ + + # create a deferred for each server we're going to look up the keys + # for; we'll resolve them once we have completed our lookups. + # These will be passed into wait_for_previous_lookups to block + # any other lookups until we have finished. + # The deferreds are called with no logcontext. server_to_deferred = { rq.server_name: defer.Deferred() for rq in verify_requests @@ -162,6 +168,8 @@ class Keyring(object): # When we've finished fetching all the keys for a given server_name, # resolve the deferred passed to `wait_for_previous_lookups` so that # any lookups waiting will proceed. + # + # map from server name to a set of request ids server_to_request_ids = {} def remove_deferreds(res, server_name, verify_request): |