mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Use a defer.gatherResults to collect results from the perspective servers
This commit is contained in:
parent
a9549fdce3
commit
1319905d7a
@ -124,18 +124,28 @@ class Keyring(object):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _get_server_verify_key_impl(self, server_name, key_ids):
|
def _get_server_verify_key_impl(self, server_name, key_ids):
|
||||||
keys = None
|
keys = None
|
||||||
|
|
||||||
|
perspective_results = []
|
||||||
for perspective_name, perspective_keys in self.perspective_servers.items():
|
for perspective_name, perspective_keys in self.perspective_servers.items():
|
||||||
try:
|
@defer.inlineCallbacks
|
||||||
keys = yield self.get_server_verify_key_v2_indirect(
|
def get_key():
|
||||||
server_name, key_ids, perspective_name, perspective_keys
|
try:
|
||||||
)
|
result = yield self.get_server_verify_key_v2_indirect(
|
||||||
break
|
server_name, key_ids, perspective_name, perspective_keys
|
||||||
except:
|
)
|
||||||
logging.info(
|
defer.returnValue(result)
|
||||||
"Unable to getting key %r for %r from %r",
|
except:
|
||||||
key_ids, server_name, perspective_name,
|
logging.info(
|
||||||
)
|
"Unable to getting key %r for %r from %r",
|
||||||
pass
|
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(
|
limiter = yield get_retry_limiter(
|
||||||
server_name,
|
server_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user