mirror of
https://github.com/rancher/os.git
synced 2025-07-15 15:51:36 +00:00
Make loading service retries configurable
This commit is contained in:
parent
88c5b5ef14
commit
29aaadd88c
@ -55,6 +55,7 @@ var schema = `{
|
|||||||
"restart_services": {"type": "array"},
|
"restart_services": {"type": "array"},
|
||||||
"hypervisor_service": {"type": "boolean"},
|
"hypervisor_service": {"type": "boolean"},
|
||||||
"shutdown_timeout": {"type": "integer"},
|
"shutdown_timeout": {"type": "integer"},
|
||||||
|
"http_load_retries": {"type": "integer"},
|
||||||
"preload_wait": {"type": "boolean"}
|
"preload_wait": {"type": "boolean"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -152,6 +152,7 @@ type RancherConfig struct {
|
|||||||
RestartServices []string `yaml:"restart_services,omitempty"`
|
RestartServices []string `yaml:"restart_services,omitempty"`
|
||||||
HypervisorService bool `yaml:"hypervisor_service,omitempty"`
|
HypervisorService bool `yaml:"hypervisor_service,omitempty"`
|
||||||
ShutdownTimeout int `yaml:"shutdown_timeout,omitempty"`
|
ShutdownTimeout int `yaml:"shutdown_timeout,omitempty"`
|
||||||
|
HTTPLoadRetries int `yaml:"http_load_retries,omitempty"`
|
||||||
PreloadWait bool `yaml:"preload_wait,omitempty"`
|
PreloadWait bool `yaml:"preload_wait,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
rancher:
|
rancher:
|
||||||
shutdown_timeout: 60
|
shutdown_timeout: 60
|
||||||
|
http_load_retries: 6
|
||||||
environment:
|
environment:
|
||||||
VERSION: {{.VERSION}}
|
VERSION: {{.VERSION}}
|
||||||
SUFFIX: {{.SUFFIX}}
|
SUFFIX: {{.SUFFIX}}
|
||||||
|
@ -108,8 +108,9 @@ func LoadFromNetwork(location string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
SetProxyEnvironmentVariables()
|
SetProxyEnvironmentVariables()
|
||||||
|
|
||||||
|
cfg := config.LoadConfig()
|
||||||
client := httpRetry.NewHTTPClient()
|
client := httpRetry.NewHTTPClient()
|
||||||
client.MaxRetries = 3
|
client.MaxRetries = cfg.Rancher.HTTPLoadRetries
|
||||||
log.Debugf("start trying LoadFromNetwork(%s)", location)
|
log.Debugf("start trying LoadFromNetwork(%s)", location)
|
||||||
bytes, err := client.GetRetry(location)
|
bytes, err := client.GetRetry(location)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user