feat: update the redis reference to cache.Cmdable instead (#535)
This commit is contained in:
@@ -24,10 +24,12 @@ import (
|
||||
|
||||
"github.com/cloudwego/eino/compose"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
|
||||
)
|
||||
|
||||
type redisStore struct {
|
||||
client *redis.Client
|
||||
client cache.Cmdable
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -38,7 +40,7 @@ const (
|
||||
func (r *redisStore) Get(ctx context.Context, checkPointID string) ([]byte, bool, error) {
|
||||
v, err := r.client.Get(ctx, fmt.Sprintf(checkpointKeyTpl, checkPointID)).Bytes()
|
||||
if err != nil {
|
||||
if errors.Is(err, redis.Nil) {
|
||||
if errors.Is(err, cache.Nil) {
|
||||
return nil, false, nil
|
||||
}
|
||||
return nil, false, err
|
||||
|
||||
Reference in New Issue
Block a user