Merge branch 'develop' of https://github.com/voidd/beego
Showing
2 changed files
with
3 additions
and
1 deletions
| ... | @@ -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 | ... | ... |
| ... | @@ -143,7 +143,7 @@ func (fp *FileProvider) SessionExist(sid string) bool { | ... | @@ -143,7 +143,7 @@ func (fp *FileProvider) SessionExist(sid string) bool { |
| 143 | 143 | ||
| 144 | // Remove all files in this save path | 144 | // Remove all files in this save path |
| 145 | func (fp *FileProvider) SessionDestroy(sid string) error { | 145 | func (fp *FileProvider) SessionDestroy(sid string) error { |
| 146 | os.Remove(path.Join(fp.savePath)) | 146 | os.Remove(path.Join(fp.savePath, string(sid[0]), string(sid[1]), sid)) |
| 147 | return nil | 147 | return nil |
| 148 | } | 148 | } |
| 149 | 149 | ... | ... |
-
Please register or sign in to post a comment