Skip to content

Commit

Permalink
feat(cache): update cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronnie committed Dec 9, 2024
1 parent 286384c commit 2fd7dd5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"time"

"github.com/zeromicro/go-zero/core/jsonx"
zerocache "github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/redis"
"github.com/zeromicro/go-zero/core/syncx"
Expand All @@ -16,11 +15,7 @@ type cacheNode struct {
}

func (c cacheNode) SetNoExpireCtx(ctx context.Context, key string, val any) error {
data, err := jsonx.Marshal(val)
if err != nil {
return err
}
return c.rds.SetCtx(ctx, key, string(data))
return c.node.SetWithExpireCtx(ctx, key, val, -1)
}

func (c cacheNode) Del(keys ...string) error {
Expand Down

0 comments on commit 2fd7dd5

Please sign in to comment.