mirror of https://github.com/goharbor/harbor.git
fix: remove noise log when core started (#18260)
Fixes: #18126 Signed-off-by: chlins <chenyuzh@vmware.com>
This commit is contained in:
parent
99b37117e1
commit
4141d77407
|
@ -25,6 +25,11 @@ import (
|
|||
"github.com/goharbor/harbor/src/pkg/project"
|
||||
"github.com/goharbor/harbor/src/pkg/project/metadata"
|
||||
"github.com/goharbor/harbor/src/pkg/repository"
|
||||
|
||||
// init the db config
|
||||
_ "github.com/goharbor/harbor/src/pkg/config/db"
|
||||
// init the rest config
|
||||
_ "github.com/goharbor/harbor/src/pkg/config/rest"
|
||||
)
|
||||
|
||||
// Define global resource manager.
|
||||
|
|
|
@ -77,12 +77,14 @@ var (
|
|||
func init() {
|
||||
registryHTTPClientTimeout = DefaultHTTPClientTimeout
|
||||
// override it if read from environment variable, in minutes
|
||||
timeout, err := strconv.ParseInt(os.Getenv("REGISTRY_HTTP_CLIENT_TIMEOUT"), 10, 64)
|
||||
if err != nil {
|
||||
log.Errorf("Failed to parse REGISTRY_HTTP_CLIENT_TIMEOUT: %v, use default value: %v", err, DefaultHTTPClientTimeout)
|
||||
} else {
|
||||
if timeout > 0 {
|
||||
registryHTTPClientTimeout = time.Duration(timeout) * time.Minute
|
||||
if env := os.Getenv("REGISTRY_HTTP_CLIENT_TIMEOUT"); len(env) > 0 {
|
||||
timeout, err := strconv.ParseInt(env, 10, 64)
|
||||
if err != nil {
|
||||
log.Errorf("Failed to parse REGISTRY_HTTP_CLIENT_TIMEOUT: %v, use default value: %v", err, DefaultHTTPClientTimeout)
|
||||
} else {
|
||||
if timeout > 0 {
|
||||
registryHTTPClientTimeout = time.Duration(timeout) * time.Minute
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue