[#184] Add config param for pool error threshold

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-07-29 09:34:26 +03:00 committed by Alex Vanin
parent af732d294c
commit 0f7737088d
5 changed files with 27 additions and 15 deletions

View file

@ -22,6 +22,8 @@ const (
defaultShutdownTimeout = 15 * time.Second
defaultPoolErrorThreshold uint32 = 100
cfgListenAddress = "listen_address"
cfgTLSCertificate = "tls_certificate"
cfgTLSKey = "tls_key"
@ -40,10 +42,11 @@ const (
cfgPprofEnabled = "pprof.enabled"
cfgPprofAddress = "pprof.address"
// Timeouts.
cfgConTimeout = "connect_timeout"
cfgReqTimeout = "request_timeout"
cfgRebalance = "rebalance_timer"
// Pool config.
cfgConTimeout = "connect_timeout"
cfgReqTimeout = "request_timeout"
cfgRebalance = "rebalance_timer"
cfgPoolErrorThreshold = "pool_error_threshold"
// Logger.
cfgLoggerLevel = "logger.level"
@ -122,6 +125,9 @@ func settings() *viper.Viper {
// logger:
v.SetDefault(cfgLoggerLevel, "debug")
// pool:
v.SetDefault(cfgPoolErrorThreshold, defaultPoolErrorThreshold)
// web-server:
v.SetDefault(cfgWebReadBufferSize, 4096)
v.SetDefault(cfgWebWriteBufferSize, 4096)