feat: update the redis reference to cache.Cmdable instead (#535)

This commit is contained in:
Ryo
2025-08-04 17:36:18 +08:00
committed by GitHub
parent c7bf6bbdec
commit adc5986d13
23 changed files with 74 additions and 78 deletions

View File

@@ -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