From 89cf4ef8af544bfda2f41fdcefa91b61fad781ef Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 26 Nov 2024 17:48:09 +0300 Subject: [PATCH] store: add missin LazyConnect option Signed-off-by: Vasiliy Tolstov --- store/options.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/store/options.go b/store/options.go index ffcafdd5..a4871cd1 100644 --- a/store/options.go +++ b/store/options.go @@ -134,6 +134,13 @@ func Timeout(td time.Duration) Option { } } +// LazyConnect initialize connection only when needed +func LazyConnect(b bool) Option { + return func(o *Options) { + o.LazyConnect = b + } +} + // Addrs contains the addresses or other connection information of the backing storage. // For example, an etcd implementation would contain the nodes of the cluster. // A SQL implementation could contain one or more connection strings.