This commit is contained in:
youngsterxyf
2016-01-08 13:47:14 +08:00
parent db2918b0aa
commit bb43d3a78c
9 changed files with 42 additions and 40 deletions

View File

@@ -109,9 +109,9 @@ ERROR:
}
// Put put cache to redis.
func (rc *Cache) Put(key string, val interface{}, timeout int64) error {
func (rc *Cache) Put(key string, val interface{}, timeout time.Duration) error {
var err error
if _, err = rc.do("SETEX", key, timeout, val); err != nil {
if _, err = rc.do("SETEX", key, int64(timeout.Seconds()), val); err != nil {
return err
}