[Plugin] Pass down ctx and use it (#2626)

* Pass down cancellable context and update http plugin

* Use context where we can
This commit is contained in:
Laurence Jones 2023-12-04 12:05:26 +00:00 committed by GitHub
parent bfc92ca1c5
commit d1bfaddb69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 7 deletions

View file

@ -65,7 +65,7 @@ func (s *Splunk) Notify(ctx context.Context, notification *protobufs.Notificatio
req.Header.Add("Authorization", fmt.Sprintf("Splunk %s", cfg.Token))
logger.Debug(fmt.Sprintf("posting event %s to %s", string(data), req.URL))
resp, err := s.Client.Do(req)
resp, err := s.Client.Do(req.WithContext(ctx))
if err != nil {
return &protobufs.Empty{}, err
}