1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 19:10:54 +00:00
This commit is contained in:
Ivan 2014-02-19 22:44:06 +04:00
commit 04c2ba01bc
2 changed files with 3 additions and 1 deletions

2
cache/file.go vendored
View File

@ -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

View File

@ -143,7 +143,7 @@ func (fp *FileProvider) SessionExist(sid string) bool {
// Remove all files in this save path // Remove all files in this save path
func (fp *FileProvider) SessionDestroy(sid string) error { func (fp *FileProvider) SessionDestroy(sid string) error {
os.Remove(path.Join(fp.savePath)) os.Remove(path.Join(fp.savePath, string(sid[0]), string(sid[1]), sid))
return nil return nil
} }