mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 21:01:31 +00:00
register interface to gob automatically
This commit is contained in:
parent
8906d3e77c
commit
05a0a4b046
2
cache/file.go
vendored
2
cache/file.go
vendored
@ -147,6 +147,8 @@ func (this *FileCache) Get(key string) interface{} {
|
|||||||
// timeout means how long to keep this file, unit of ms.
|
// timeout means how long to keep this file, unit of ms.
|
||||||
// if timeout equals FileCacheEmbedExpiry(default is 0), cache this item forever.
|
// if timeout equals FileCacheEmbedExpiry(default is 0), cache this item forever.
|
||||||
func (this *FileCache) Put(key string, val interface{}, timeout int64) error {
|
func (this *FileCache) Put(key string, val interface{}, timeout int64) error {
|
||||||
|
gob.Register(val)
|
||||||
|
|
||||||
filename := this.getCacheFileName(key)
|
filename := this.getCacheFileName(key)
|
||||||
var item FileCacheItem
|
var item FileCacheItem
|
||||||
item.Data = val
|
item.Data = val
|
||||||
|
Loading…
Reference in New Issue
Block a user