refactor: use web module timeout everywhere
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user