From 0317aa1401ed2da0a2e9a9785a74a5ab0d96fa4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Tue, 12 Nov 2024 02:46:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20redis=E6=B7=BB=E5=8A=A0=E6=B8=85?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/db/redis.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/db/redis.go b/pkg/db/redis.go index 5e8e6fd4..8a33058e 100644 --- a/pkg/db/redis.go +++ b/pkg/db/redis.go @@ -169,3 +169,8 @@ func (r *Redis) Data(page, pageSize int) ([]RedisKV, error) { return result, nil } + +func (r *Redis) Clear() error { + _, err := r.conn.Do("FLUSHDB") + return err +}