upgrade: update wrapper
This commit is contained in:
9
redis.go
9
redis.go
@ -9,9 +9,10 @@ package cache
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
cacheAbstract "git.zhangdeman.cn/zhangdeman/cache/abstract"
|
||||
"git.zhangdeman.cn/zhangdeman/redis"
|
||||
"git.zhangdeman.cn/zhangdeman/wrapper"
|
||||
"git.zhangdeman.cn/zhangdeman/wrapper/op_string"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -49,7 +50,11 @@ func (r *Redis) TTL(ctx context.Context, instanceFlag string, key string) (int64
|
||||
ctx = context.Background()
|
||||
}
|
||||
res := redis.Wrapper.TTL(ctx, instanceFlag, key)
|
||||
return wrapper.String(res.Result).ToInt64().Value, res.Err
|
||||
if nil != res.Err {
|
||||
return 0, res.Err
|
||||
}
|
||||
ttlRes := op_string.ToBaseTypeValue[int64](res.Result)
|
||||
return ttlRes.Value, ttlRes.Err
|
||||
}
|
||||
|
||||
// Set 设置缓存
|
||||
|
Reference in New Issue
Block a user