refactor: use web module timeout everywhere

This commit is contained in:
2021-09-04 23:18:34 +02:00
parent e68c7fc71c
commit a3e02540f6
3 changed files with 8 additions and 5 deletions

View File

@ -6,7 +6,6 @@ import (
"io/ioutil"
"net/http"
"strings"
"time"
"coopcloud.tech/abra/web"
"github.com/docker/distribution/reference"
@ -41,7 +40,7 @@ func getRegv2Token(image reference.Named) (string, error) {
return "", err
}
client := &http.Client{Timeout: 10 * time.Second}
client := &http.Client{Timeout: web.Timeout}
res, err := client.Do(req)
if err != nil {
return "", err
@ -97,7 +96,7 @@ func GetTagDigest(image reference.Named) (string, error) {
"Authorization": []string{fmt.Sprintf("Bearer %s", token)},
}
client := &http.Client{Timeout: 10 * time.Second}
client := &http.Client{Timeout: web.Timeout}
res, err := client.Do(req)
if err != nil {
return "", err