mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Handle new FederationError type in PerformJoin
This commit is contained in:
parent
1e174e04eb
commit
53787d539d
|
|
@ -161,19 +161,17 @@ func (r *FederationInternalAPI) performJoinUsingServer(
|
||||||
KeyRing: r.keyRing,
|
KeyRing: r.keyRing,
|
||||||
EventProvider: federatedEventProvider(ctx, r.federation, r.keyRing, user.Domain(), serverName),
|
EventProvider: federatedEventProvider(ctx, r.federation, r.keyRing, user.Domain(), serverName),
|
||||||
}
|
}
|
||||||
callbacks := fclient.PerformJoinCallbacks{
|
response, joinErr := fclient.PerformJoin(ctx, r.federation, joinInput)
|
||||||
FederationFailure: func(server spec.ServerName) {
|
|
||||||
r.statistics.ForServer(server).Failure()
|
|
||||||
},
|
|
||||||
FederationSuccess: func(server spec.ServerName) {
|
|
||||||
r.statistics.ForServer(server).Success(statistics.SendDirect)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
response, err := fclient.PerformJoin(ctx, r.federation, joinInput, callbacks)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !joinErr.Reachable {
|
||||||
|
r.statistics.ForServer(joinErr.ServerName).Failure()
|
||||||
|
} else {
|
||||||
|
r.statistics.ForServer(joinErr.ServerName).Success(statistics.SendDirect)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
r.statistics.ForServer(serverName).Success(statistics.SendDirect)
|
||||||
|
|
||||||
// We need to immediately update our list of joined hosts for this room now as we are technically
|
// We need to immediately update our list of joined hosts for this room now as we are technically
|
||||||
// joined. We must do this synchronously: we cannot rely on the roomserver output events as they
|
// joined. We must do this synchronously: we cannot rely on the roomserver output events as they
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue