From bb94dc6d3cec636650ca6685685c631936af7f36 Mon Sep 17 00:00:00 2001 From: otto <965391514@qq.com> Date: Mon, 8 Apr 2024 17:22:46 +0800 Subject: [PATCH] up --- task/task.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/task/task.go b/task/task.go index 37576f5..62ad309 100644 --- a/task/task.go +++ b/task/task.go @@ -24,7 +24,6 @@ var ( ) func NewRedis() *redis.Client { - once.Do(func() { redisConfig := &cproto.Redis{} _ = configv2.Get(configv2.Redis, redisConfig) @@ -51,6 +50,7 @@ func NewTask() { func task(start, end int64) error { redisClient := NewRedis() + defer func() { redisClient.Close() }() result, err := redisClient.ZRangeWithScores(context.Background(), hotKey, start, end).Result() if err != nil { return err