diff --git a/pkg/services/notifications/webhook.go b/pkg/services/notifications/webhook.go index 2ea0ea19048..9c790c3c549 100644 --- a/pkg/services/notifications/webhook.go +++ b/pkg/services/notifications/webhook.go @@ -11,8 +11,6 @@ import ( "net/http" "time" - "golang.org/x/net/context/ctxhttp" - "github.com/grafana/grafana/pkg/util" ) @@ -52,7 +50,7 @@ func (ns *NotificationService) sendWebRequestSync(ctx context.Context, webhook * return fmt.Errorf("webhook only supports HTTP methods PUT or POST") } - request, err := http.NewRequest(webhook.HttpMethod, webhook.Url, bytes.NewReader([]byte(webhook.Body))) + request, err := http.NewRequestWithContext(ctx, webhook.HttpMethod, webhook.Url, bytes.NewReader([]byte(webhook.Body))) if err != nil { return err } @@ -72,7 +70,7 @@ func (ns *NotificationService) sendWebRequestSync(ctx context.Context, webhook * request.Header.Set(k, v) } - resp, err := ctxhttp.Do(ctx, netClient, request) + resp, err := netClient.Do(request) if err != nil { return err } diff --git a/pkg/services/provisioning/notifiers/alert_notifications.go b/pkg/services/provisioning/notifiers/alert_notifications.go index aac68649cda..de1621a7177 100644 --- a/pkg/services/provisioning/notifiers/alert_notifications.go +++ b/pkg/services/provisioning/notifiers/alert_notifications.go @@ -1,11 +1,12 @@ package notifiers import ( + "context" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/services/encryption" "github.com/grafana/grafana/pkg/services/notifications" - "golang.org/x/net/context" ) type Manager interface {