mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Tweak performJoinUsingServer error handling
This commit is contained in:
parent
3ba7291598
commit
a28297c39d
1 changed files with 10 additions and 2 deletions
|
@ -239,7 +239,9 @@ func (r *FederationSenderInternalAPI) performJoinUsingServer(
|
||||||
// to complete, but if the client does give up waiting, we'll
|
// to complete, but if the client does give up waiting, we'll
|
||||||
// still continue to process the join anyway so that we don't
|
// still continue to process the join anyway so that we don't
|
||||||
// waste the effort.
|
// waste the effort.
|
||||||
|
waiterr := make(chan error, 1)
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(waiterr)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
// TODO: Can we expand Check here to return a list of missing auth
|
// TODO: Can we expand Check here to return a list of missing auth
|
||||||
|
@ -250,6 +252,7 @@ func (r *FederationSenderInternalAPI) performJoinUsingServer(
|
||||||
"room_id": roomID,
|
"room_id": roomID,
|
||||||
"user_id": userID,
|
"user_id": userID,
|
||||||
}).WithError(err).Error("Failed to process room join response")
|
}).WithError(err).Error("Failed to process room join response")
|
||||||
|
waiterr <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,12 +270,17 @@ func (r *FederationSenderInternalAPI) performJoinUsingServer(
|
||||||
"room_id": roomID,
|
"room_id": roomID,
|
||||||
"user_id": userID,
|
"user_id": userID,
|
||||||
}).WithError(err).Error("Failed to send room join response to roomserver")
|
}).WithError(err).Error("Failed to send room join response to roomserver")
|
||||||
|
waiterr <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
<-ctx.Done()
|
select {
|
||||||
return nil
|
case <-ctx.Done():
|
||||||
|
return nil
|
||||||
|
case err := <-waiterr:
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PerformOutboundPeekRequest implements api.FederationSenderInternalAPI
|
// PerformOutboundPeekRequest implements api.FederationSenderInternalAPI
|
||||||
|
|
Loading…
Reference in a new issue