5d02b18d by Pengfei Xue Committed by asta.xie

register interface to gob automatically

1 parent 97b68bdd
...@@ -147,6 +147,8 @@ func (this *FileCache) Get(key string) interface{} { ...@@ -147,6 +147,8 @@ func (this *FileCache) Get(key string) interface{} {
147 // timeout means how long to keep this file, unit of ms. 147 // timeout means how long to keep this file, unit of ms.
148 // if timeout equals FileCacheEmbedExpiry(default is 0), cache this item forever. 148 // if timeout equals FileCacheEmbedExpiry(default is 0), cache this item forever.
149 func (this *FileCache) Put(key string, val interface{}, timeout int64) error { 149 func (this *FileCache) Put(key string, val interface{}, timeout int64) error {
150 gob.Register(val)
151
150 filename := this.getCacheFileName(key) 152 filename := this.getCacheFileName(key)
151 var item FileCacheItem 153 var item FileCacheItem
152 item.Data = val 154 item.Data = val
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!