Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
1319905d
Commit
1319905d
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
Use a defer.gatherResults to collect results from the perspective servers
parent
a9549fdc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/crypto/keyring.py
+21
-11
21 additions, 11 deletions
synapse/crypto/keyring.py
with
21 additions
and
11 deletions
synapse/crypto/keyring.py
+
21
−
11
View file @
1319905d
...
...
@@ -124,18 +124,28 @@ class Keyring(object):
@defer.inlineCallbacks
def
_get_server_verify_key_impl
(
self
,
server_name
,
key_ids
):
keys
=
None
perspective_results
=
[]
for
perspective_name
,
perspective_keys
in
self
.
perspective_servers
.
items
():
try
:
keys
=
yield
self
.
get_server_verify_key_v2_indirect
(
server_name
,
key_ids
,
perspective_name
,
perspective_keys
)
break
except
:
logging
.
info
(
"
Unable to getting key %r for %r from %r
"
,
key_ids
,
server_name
,
perspective_name
,
)
pass
@defer.inlineCallbacks
def
get_key
():
try
:
result
=
yield
self
.
get_server_verify_key_v2_indirect
(
server_name
,
key_ids
,
perspective_name
,
perspective_keys
)
defer
.
returnValue
(
result
)
except
:
logging
.
info
(
"
Unable to getting key %r for %r from %r
"
,
key_ids
,
server_name
,
perspective_name
,
)
perspective_results
.
append
(
get_key
())
perspective_results
=
yield
defer
.
gatherResults
(
perspective_results
)
for
results
in
perspective_results
:
if
results
is
not
None
:
keys
=
results
limiter
=
yield
get_retry_limiter
(
server_name
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment