Skip to content

Commit

Permalink
New http client for every beacon request
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed Apr 11, 2024
1 parent 293e2ea commit 634cce7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions beaconclient/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ func fetchBeacon(method, url string, payload []byte, dst any, timeout *time.Dura
}
req.Header.Set("accept", "application/json")

client := http.DefaultClient
client := &http.Client{}
if timeout != nil && timeout.Seconds() > 0 {
client = &http.Client{ //nolint:exhaustruct
Timeout: *timeout,
}
client.Timeout = *timeout
}
resp, err := client.Do(req)
if err != nil {
Expand Down

0 comments on commit 634cce7

Please sign in to comment.