diff options
author | Erik Johnston <erik@matrix.org> | 2016-03-18 13:55:16 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-03-18 13:55:16 +0000 |
commit | 3c5f25507b7a62165a782420add4f9dedcec0b3e (patch) | |
tree | d75b1a3933edbe10636980f32930716e7187c078 /synapse | |
parent | Merge pull request #650 from matrix-org/dbkr/register_idempotent_with_username (diff) | |
download | synapse-3c5f25507b7a62165a782420add4f9dedcec0b3e.tar.xz |
Yield on EDU handling
Diffstat (limited to '')
-rw-r--r-- | synapse/federation/federation_server.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index e8bfbe7cb5..a961b17aea 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -137,8 +137,8 @@ class FederationServer(FederationBase): logger.exception("Failed to handle PDU") if hasattr(transaction, "edus"): - for edu in [Edu(**x) for x in transaction.edus]: - self.received_edu( + for edu in (Edu(**x) for x in transaction.edus): + yield self.received_edu( transaction.origin, edu.edu_type, edu.content @@ -161,11 +161,12 @@ class FederationServer(FederationBase): ) defer.returnValue((200, response)) + @defer.inlineCallbacks def received_edu(self, origin, edu_type, content): received_edus_counter.inc() if edu_type in self.edu_handlers: - self.edu_handlers[edu_type](origin, content) + yield self.edu_handlers[edu_type](origin, content) else: logger.warn("Received EDU of type %s with no handler", edu_type) |