Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Convert to async/await.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Mar 6, 2020
1 parent 4a8a291 commit d9b4d91
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,14 @@ async def get_room_state_ids(

return state_event_ids, auth_event_ids

@defer.inlineCallbacks
def _check_sigs_and_hash_and_fetch(
async def _check_sigs_and_hash_and_fetch(
self,
origin: str,
pdus: List[EventBase],
room_version: str,
outlier: bool = False,
include_none: bool = False,
):
) -> List[EventBase]:
"""Takes a list of PDUs and checks the signatures and hashs of each
one. If a PDU fails its signature check then we check if we have it in
the database and if not then request if from the originating server of
Expand Down Expand Up @@ -415,7 +414,7 @@ def handle_check_result(pdu: EventBase, deferred: Deferred):
handle = preserve_fn(handle_check_result)
deferreds2 = [handle(pdu, deferred) for pdu, deferred in zip(pdus, deferreds)]

valid_pdus = yield make_deferred_yieldable(
valid_pdus = await make_deferred_yieldable(
defer.gatherResults(deferreds2, consumeErrors=True)
).addErrback(unwrapFirstError)

Expand Down

0 comments on commit d9b4d91

Please sign in to comment.