mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 07:50:54 +00:00
Add lock while releasing session
Solve the problem of SessionRead failure while ReleaseSession is in progress
This commit is contained in:
parent
c5118e9535
commit
ed73bdcfab
@ -78,6 +78,8 @@ func (fs *FileSessionStore) SessionID() string {
|
||||
|
||||
// SessionRelease Write file session to local file with Gob string
|
||||
func (fs *FileSessionStore) SessionRelease(w http.ResponseWriter) {
|
||||
filepder.lock.Lock()
|
||||
defer filepder.lock.Unlock()
|
||||
b, err := EncodeGob(fs.values)
|
||||
if err != nil {
|
||||
SLogger.Println(err)
|
||||
|
Loading…
Reference in New Issue
Block a user