Alerting: Use ErrImagesDone in Discord and SensuGo (#51106)

pull/50734/head
George Robinson 3 years ago committed by GitHub
parent 6a1b8693e0
commit 7235480be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      pkg/services/ngalert/notifier/channels/discord.go
  2. 1
      pkg/services/ngalert/notifier/channels/sensugo.go

@ -201,8 +201,7 @@ func (d DiscordNotifier) constructAttachments(ctx context.Context, as []*types.A
_ = withStoredImages(ctx, d.log, d.images,
func(index int, image *ngmodels.Image) error {
if embedQuota < 1 {
// TODO: Could be a sentinel error to stop execution.
return nil
return ErrImagesDone
}
if image == nil {

@ -147,6 +147,7 @@ func (sn *SensuGoNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool
// one image per request.
if image != nil && image.URL != "" && imageURL == "" {
imageURL = image.URL
return ErrImagesDone
}
return nil
}, as...)

Loading…
Cancel
Save