From fbbb9bfacdab3434da645deec84c5358123d7a00 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 10 Aug 2021 09:29:27 +0200 Subject: [PATCH] Don't allow 0 for timeout redis option 0 stands for deactivate, which makes no sense here. --- pkg/icingaredis/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/icingaredis/client.go b/pkg/icingaredis/client.go index dd05be22..a56cb105 100644 --- a/pkg/icingaredis/client.go +++ b/pkg/icingaredis/client.go @@ -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") }