mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
PerformServersAlive in PerformBroadcastEDU
This commit is contained in:
parent
15dc1f4d03
commit
8cb16d6482
|
|
@ -319,6 +319,11 @@ func (r *FederationSenderInternalAPI) PerformBroadcastEDU(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("r.db.GetAllJoinedHosts: %w", err)
|
return fmt.Errorf("r.db.GetAllJoinedHosts: %w", err)
|
||||||
}
|
}
|
||||||
|
if len(destinations) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
logrus.WithContext(ctx).Infof("Sending wake-up EDU to %d destination(s)", len(destinations))
|
||||||
|
|
||||||
edu := &gomatrixserverlib.EDU{
|
edu := &gomatrixserverlib.EDU{
|
||||||
Type: "org.matrix.dendrite.wakeup",
|
Type: "org.matrix.dendrite.wakeup",
|
||||||
|
|
@ -328,5 +333,13 @@ func (r *FederationSenderInternalAPI) PerformBroadcastEDU(
|
||||||
return fmt.Errorf("r.queues.SendEDU: %w", err)
|
return fmt.Errorf("r.queues.SendEDU: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wakeReq := &api.PerformServersAliveRequest{
|
||||||
|
Servers: destinations,
|
||||||
|
}
|
||||||
|
wakeRes := &api.PerformServersAliveResponse{}
|
||||||
|
if err := r.PerformServersAlive(ctx, &wakeReq, &wakeRes); err != nil {
|
||||||
|
return fmt.Errorf("r.PerformServersAlive: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue