mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 18:50:55 +00:00
fix memory cache Put method should set value when key exist.
This commit is contained in:
parent
42958ddd41
commit
8e8d39d3cb
6
cache/memory.go
vendored
6
cache/memory.go
vendored
@ -53,11 +53,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, expired int64) error
|
|||||||
Lastaccess: time.Now(),
|
Lastaccess: time.Now(),
|
||||||
expired: expired,
|
expired: expired,
|
||||||
}
|
}
|
||||||
if _, ok := bc.items[name]; ok {
|
bc.items[name] = &t
|
||||||
return errors.New("the key is exist")
|
|
||||||
} else {
|
|
||||||
bc.items[name] = &t
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user