summary refs log tree commit diff
path: root/synapse/crypto
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-19 13:43:34 +0100
committerErik Johnston <erik@matrix.org>2015-05-19 13:43:34 +0100
commit5ae4a84211e4ca0247ab3bca77b159f843d6ead2 (patch)
tree2e698bcb82f115389ab728b810b9722e3df1063c /synapse/crypto
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/join_perf (diff)
downloadsynapse-5ae4a84211e4ca0247ab3bca77b159f843d6ead2.tar.xz
Don't always hit get_server_verify_key_v1_direct
Diffstat (limited to 'synapse/crypto')
-rw-r--r--synapse/crypto/keyring.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py
index 2a5a8914c0..35f9ac3517 100644
--- a/synapse/crypto/keyring.py
+++ b/synapse/crypto/keyring.py
@@ -164,12 +164,17 @@ class Keyring(object):
                     keys = yield self.get_server_verify_key_v2_direct(
                         server_name, key_ids
                     )
-                except:
-                    pass
+                except Exception as e:
+                    logging.info(
+                        "Unable to getting key %r for %r directly: %s %s",
+                        key_ids, server_name,
+                        type(e).__name__, str(e.message),
+                    )
 
-            keys = yield self.get_server_verify_key_v1_direct(
-                server_name, key_ids
-            )
+            if keys is None:
+                keys = yield self.get_server_verify_key_v1_direct(
+                    server_name, key_ids
+                )
 
         for key_id in key_ids:
             if key_id in keys: