fix: support retryable http clients
All checks were successful
continuous-integration/drone/push Build is passing

Closes coop-cloud/organising#257.
This commit is contained in:
2021-11-22 18:28:18 +01:00
parent a18729bf98
commit cb32e88cde
6 changed files with 37 additions and 8 deletions

View File

@ -3,7 +3,6 @@ package web
import (
"encoding/json"
"net/http"
"time"
)
@ -13,7 +12,7 @@ const Timeout = 10 * time.Second
// ReadJSON reads JSON and parses it into your chosen interface pointer
func ReadJSON(url string, target interface{}) error {
httpClient := &http.Client{Timeout: Timeout}
httpClient := NewHTTPRetryClient()
res, err := httpClient.Get(url)
if err != nil {
return err