diff --git a/federationsender/internal/perform.go b/federationsender/internal/perform.go index d9a4b963e..9dcd97f6d 100644 --- a/federationsender/internal/perform.go +++ b/federationsender/internal/perform.go @@ -319,6 +319,11 @@ func (r *FederationSenderInternalAPI) PerformBroadcastEDU( if err != nil { 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{ Type: "org.matrix.dendrite.wakeup", @@ -328,5 +333,13 @@ func (r *FederationSenderInternalAPI) PerformBroadcastEDU( 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 }