Don't allow 0 for timeout redis option

0 stands for deactivate, which makes no sense here.
This commit is contained in:
Eric Lippmann 2021-08-10 09:29:27 +02:00
parent 8232000524
commit fbbb9bfacd

View file

@ -45,6 +45,9 @@ func (o *Options) UnmarshalYAML(unmarshal func(interface{}) error) error {
return internal.CantUnmarshalYAML(err, o)
}
if o.Timeout == 0 {
return errors.New("timeout cannot be 0. Configure a value greater than zero, or use -1 for no timeout")
}
if o.MaxHMGetConnections < 1 {
return errors.New("max_hmget_connections must be at least 1")
}