From a3cb7dabae5e55c742c73e0b3e6c0831e74e82c8 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 20 May 2021 22:49:30 +0300 Subject: [PATCH] fix Exists method Signed-off-by: Vasiliy Tolstov --- redis.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redis.go b/redis.go index 5c810b2..9dc74de 100644 --- a/redis.go +++ b/redis.go @@ -45,8 +45,11 @@ func (r *rkv) Exists(ctx context.Context, key string, opts ...store.ExistsOption // options.Table = r.opts.Table //} rkey := fmt.Sprintf("%s%s", r.opts.Table, key) - err := r.cli.Exists(ctx, rkey).Err() + st, err := r.cli.Exists(ctx, rkey).Result() if err != nil { + return err + } + if st == 0 { return store.ErrNotFound } return nil