summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-05-05 11:36:24 +0100
committerErik Johnston <erik@matrix.org>2021-05-05 11:36:24 +0100
commitb0d014819f7e9d14810614e1ffc5f3caaf46927a (patch)
tree12bbe0ff12f46bfb93f4b309f710f1d8cc4c3a60
parentMerge branch 'erikj/better_backfill' into erikj/test_send (diff)
downloadsynapse-b0d014819f7e9d14810614e1ffc5f3caaf46927a.tar.xz
Fix log contexts
-rw-r--r--synapse/crypto/keyring.py5
-rw-r--r--synapse/federation/federation_base.py4
2 files changed, 5 insertions, 4 deletions
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py
index 984a4be54d..8b695612c3 100644
--- a/synapse/crypto/keyring.py
+++ b/synapse/crypto/keyring.py
@@ -225,12 +225,13 @@ class Keyring:
     ) -> List[defer.Deferred]:
         return [
             defer.ensureDeferred(
-                self._verify_object(
+                run_in_background(
+                    self._verify_object,
                     VerifyJsonRequest.from_event(
                         server_name,
                         validity_time,
                         event,
-                    )
+                    ),
                 )
             )
             for server_name, event, validity_time in server_and_json
diff --git a/synapse/federation/federation_base.py b/synapse/federation/federation_base.py
index 3fe496dcd3..a86a0b5f5e 100644
--- a/synapse/federation/federation_base.py
+++ b/synapse/federation/federation_base.py
@@ -73,10 +73,10 @@ class FederationBase:
               * throws a SynapseError if the signature check failed.
             The deferreds run their callbacks in the sentinel
         """
-        deferreds = _check_sigs_on_pdus(self.keyring, room_version, pdus)
-
         ctx = current_context()
 
+        deferreds = _check_sigs_on_pdus(self.keyring, room_version, pdus)
+
         @defer.inlineCallbacks
         def callback(_, pdu: EventBase):
             with PreserveLoggingContext(ctx):