fix Exists method

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-05-20 22:49:30 +03:00
parent 6b9fc567ca
commit a3cb7dabae

View File

@ -45,8 +45,11 @@ func (r *rkv) Exists(ctx context.Context, key string, opts ...store.ExistsOption
// options.Table = r.opts.Table // options.Table = r.opts.Table
//} //}
rkey := fmt.Sprintf("%s%s", r.opts.Table, key) 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 { if err != nil {
return err
}
if st == 0 {
return store.ErrNotFound return store.ErrNotFound
} }
return nil return nil