Commit cb66419a by yemin

no message

parent 286200cd
...@@ -87,17 +87,7 @@ func Get(key string) []byte { ...@@ -87,17 +87,7 @@ func Get(key string) []byte {
return rByte return rByte
} }
func Set(k, v string) error { func Set(k, v string, timeoutSecond int) error {
e := getDb().Set(k, v, 0).Err()
if e == nil {
log.Debug(fmt.Sprintf("设置缓存成功:%s %s", k, v))
} else {
log.Debug(fmt.Sprintf("设置缓存失败:%s %s %s", k, v, e))
}
return e
}
func SetNx(k, v string, timeoutSecond int) error {
e := getDb().Set(k, v, time.Duration(timeoutSecond)*time.Second).Err() e := getDb().Set(k, v, time.Duration(timeoutSecond)*time.Second).Err()
if e == nil { if e == nil {
log.Debug(fmt.Sprintf("设置缓存成功:%s %s", k, v)) log.Debug(fmt.Sprintf("设置缓存成功:%s %s", k, v))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment