feat: limit max connection count (#2701)

This commit is contained in:
BoYanZh
2022-12-14 10:33:58 +08:00
committed by GitHub
parent 33bae52fa1
commit 7947ff1ae4
3 changed files with 21 additions and 0 deletions

View File

@ -47,6 +47,7 @@ type Config struct {
TempDir string `json:"temp_dir" env:"TEMP_DIR"`
BleveDir string `json:"bleve_dir" env:"BLEVE_DIR"`
Log LogConfig `json:"log"`
MaxConnections int `json:"max_connections" env:"MAX_CONNECTIONS"`
}
func DefaultConfig() *Config {
@ -74,5 +75,6 @@ func DefaultConfig() *Config {
MaxBackups: 5,
MaxAge: 28,
},
MaxConnections: 0,
}
}