Couple of fixes
This commit is contained in:
@@ -29,10 +29,10 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func NewHTTPClient(token string, maxRetries int, timeout time.Duration) *HTTPClient {
|
||||
func NewHTTPClient(token string, maxRetries int) *HTTPClient {
|
||||
return &HTTPClient{
|
||||
BearerToken: token,
|
||||
Client: &http.Client{Timeout: timeout},
|
||||
Client: &http.Client{},
|
||||
MaxRetries: maxRetries,
|
||||
Backoff: func(attempt int) time.Duration {
|
||||
return time.Duration(attempt) * time.Second
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
zurghttp "github.com/debridmediamanager.com/zurg/pkg/http"
|
||||
"go.uber.org/zap"
|
||||
@@ -22,9 +21,7 @@ type RealDebrid struct {
|
||||
|
||||
func NewRealDebrid(accessToken string, log *zap.SugaredLogger) *RealDebrid {
|
||||
maxRetries := 10
|
||||
timeout := 10 * time.Second
|
||||
client := zurghttp.NewHTTPClient(accessToken, maxRetries, timeout)
|
||||
log.Debugf("Created an HTTP client with %d max retries and %s timeout", maxRetries, timeout)
|
||||
client := zurghttp.NewHTTPClient(accessToken, maxRetries)
|
||||
return &RealDebrid{
|
||||
log: log,
|
||||
client: client,
|
||||
|
||||
Reference in New Issue
Block a user