fix: rename READY deadline to CLUSTER deadline ENV (#10535)

This commit is contained in:
Harshavardhana
2020-09-23 09:14:33 -07:00
committed by GitHub
parent eec69d6796
commit 8b74a72b21
7 changed files with 40 additions and 39 deletions

View File

@@ -31,7 +31,7 @@ type apiConfig struct {
requestsDeadline time.Duration
requestsPool chan struct{}
readyDeadline time.Duration
clusterDeadline time.Duration
corsAllowOrigins []string
}
@@ -39,7 +39,7 @@ func (t *apiConfig) init(cfg api.Config, setDriveCount int) {
t.mu.Lock()
defer t.mu.Unlock()
t.readyDeadline = cfg.ReadyDeadline
t.clusterDeadline = cfg.ClusterDeadline
t.corsAllowOrigins = cfg.CorsAllowOrigin
var apiRequestsMaxPerNode int
@@ -74,15 +74,15 @@ func (t *apiConfig) getCorsAllowOrigins() []string {
return corsAllowOrigins
}
func (t *apiConfig) getReadyDeadline() time.Duration {
func (t *apiConfig) getClusterDeadline() time.Duration {
t.mu.RLock()
defer t.mu.RUnlock()
if t.readyDeadline == 0 {
if t.clusterDeadline == 0 {
return 10 * time.Second
}
return t.readyDeadline
return t.clusterDeadline
}
func (t *apiConfig) getRequestsPool() (chan struct{}, <-chan time.Time) {