Unverified Commit ed73bdcf authored by HANG ZHOU's avatar HANG ZHOU Committed by GitHub

Add lock while releasing session

Solve the problem of SessionRead failure while ReleaseSession is in progress
parent c5118e95
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment