From b955c369590ae9b3a404ddd075df1b97298ab2d5 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Fri, 28 Apr 2023 16:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/redisCli/util.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resource/redisCli/util.go b/resource/redisCli/util.go index ded2242..b6b4f80 100644 --- a/resource/redisCli/util.go +++ b/resource/redisCli/util.go @@ -65,3 +65,12 @@ func IncrNumExpire(key string, num int64, expiration time.Duration) (int64, erro } return times, nil } + +func DelCache(key string) error { + err := RedisClient.Del(context.Background(), key).Err() + if err != nil { + mylogrus.MyLog.Errorf("DelCache key:%s, err:%s", key, err) + return err + } + return nil +} -- 2.22.0