From 9fe2e12cfc1174d74faf48082e27aa5000e517c7 Mon Sep 17 00:00:00 2001 From: Ben Fiola Date: Tue, 19 Nov 2024 21:41:27 -0800 Subject: [PATCH] fix: invert client check when closing connections --- internal/provider/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/client.go b/internal/provider/client.go index 066896b..673fea1 100644 --- a/internal/provider/client.go +++ b/internal/provider/client.go @@ -89,7 +89,7 @@ func (c *client) maybeCloseClient() error { defer c.mutex.Unlock() c.mutex.Lock() c.connections -= 1 - if c.connections == 0 && c.client == nil { + if c.connections == 0 && c.client != nil { err := c.client.Close() c.client = nil if err != nil {