feat: add a redis abstraction to support different versions of the redis sdk (#549)

This commit is contained in:
Ryo
2025-08-05 16:09:54 +08:00
committed by GitHub
parent d4d0ba6b9a
commit ab0ce50df5
11 changed files with 316 additions and 31 deletions

View File

@@ -23,7 +23,6 @@ import (
"time"
"github.com/cloudwego/eino/compose"
"github.com/redis/go-redis/v9"
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
)
@@ -52,6 +51,6 @@ func (r *redisStore) Set(ctx context.Context, checkPointID string, checkPoint []
return r.client.Set(ctx, fmt.Sprintf(checkpointKeyTpl, checkPointID), checkPoint, checkpointExpire).Err()
}
func NewRedisStore(client *redis.Client) compose.CheckPointStore {
func NewRedisStore(client cache.Cmdable) compose.CheckPointStore {
return &redisStore{client: client}
}