From fa06cf3dcb9dcca39126bd86b7383e1ad9f5b21d Mon Sep 17 00:00:00 2001 From: yitter Date: Fri, 2 Apr 2021 23:25:43 +0800 Subject: [PATCH] auto commit --- Go/source/regworkerid/reghelper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Go/source/regworkerid/reghelper.go b/Go/source/regworkerid/reghelper.go index 20cfab4..64a472a 100644 --- a/Go/source/regworkerid/reghelper.go +++ b/Go/source/regworkerid/reghelper.go @@ -66,6 +66,7 @@ func RegisterWorkerId(ip string, port int, password string, maxWorkerId int) int _ConnString = ip + ":" + strconv.Itoa(port) _Password = password _client = newRedisClient() + defer _client.Close() _, err := _client.Ping(_ctx).Result() if err != nil { @@ -74,7 +75,6 @@ func RegisterWorkerId(ip string, port int, password string, maxWorkerId int) int if _Log { fmt.Println("init redis ok") } - defer _client.Close() } _loopCount = 0