mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
[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:
parent
bfc92ca1c5
commit
d1bfaddb69
5 changed files with 5 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue