mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-11 15:04:19 -05:00
Handle recieving failures in transactions
This commit is contained in:
parent
c2b1dbd84c
commit
02bfa889de
@ -114,7 +114,15 @@ class FederationServer(FederationBase):
|
|||||||
with PreserveLoggingContext():
|
with PreserveLoggingContext():
|
||||||
dl = []
|
dl = []
|
||||||
for pdu in pdu_list:
|
for pdu in pdu_list:
|
||||||
dl.append(self._handle_new_pdu(transaction.origin, pdu))
|
d = self._handle_new_pdu(transaction.origin, pdu)
|
||||||
|
|
||||||
|
def handle_failure(failure):
|
||||||
|
failure.trap(FederationError)
|
||||||
|
self.enqueue_failure(failure.value, transaction.origin)
|
||||||
|
|
||||||
|
d.addErrback(handle_failure)
|
||||||
|
|
||||||
|
dl.append(d)
|
||||||
|
|
||||||
if hasattr(transaction, "edus"):
|
if hasattr(transaction, "edus"):
|
||||||
for edu in [Edu(**x) for x in transaction.edus]:
|
for edu in [Edu(**x) for x in transaction.edus]:
|
||||||
@ -124,6 +132,9 @@ class FederationServer(FederationBase):
|
|||||||
edu.content
|
edu.content
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for failure in getattr(transaction, "failures", []):
|
||||||
|
logger.info("Got failure %r", failure)
|
||||||
|
|
||||||
results = yield defer.DeferredList(dl, consumeErrors=True)
|
results = yield defer.DeferredList(dl, consumeErrors=True)
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
|
Loading…
Reference in New Issue
Block a user