mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Use ErrImagesDone in Discord and SensuGo (#51106)
This commit is contained in:
parent
6a1b8693e0
commit
7235480be5
@ -201,8 +201,7 @@ func (d DiscordNotifier) constructAttachments(ctx context.Context, as []*types.A
|
|||||||
_ = withStoredImages(ctx, d.log, d.images,
|
_ = withStoredImages(ctx, d.log, d.images,
|
||||||
func(index int, image *ngmodels.Image) error {
|
func(index int, image *ngmodels.Image) error {
|
||||||
if embedQuota < 1 {
|
if embedQuota < 1 {
|
||||||
// TODO: Could be a sentinel error to stop execution.
|
return ErrImagesDone
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if image == nil {
|
if image == nil {
|
||||||
|
@ -147,6 +147,7 @@ func (sn *SensuGoNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool
|
|||||||
// one image per request.
|
// one image per request.
|
||||||
if image != nil && image.URL != "" && imageURL == "" {
|
if image != nil && image.URL != "" && imageURL == "" {
|
||||||
imageURL = image.URL
|
imageURL = image.URL
|
||||||
|
return ErrImagesDone
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}, as...)
|
}, as...)
|
||||||
|
Loading…
Reference in New Issue
Block a user