1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 11:00:19 +00:00
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
}