Skip to content

Commit c20e1ab

Browse files
committed
Merge pull request beego#463 from NormanZhang/develop
Update SessionExist to close the db connection
2 parents 63f1997 + dc767b6 commit c20e1ab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

session/sess_mysql.go

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func (mp *MysqlProvider) SessionRead(sid string) (SessionStore, error) {
115115

116116
func (mp *MysqlProvider) SessionExist(sid string) bool {
117117
c := mp.connectInit()
118+
defer c.Close()
118119
row := c.QueryRow("select session_data from session where session_key=?", sid)
119120
var sessiondata []byte
120121
err := row.Scan(&sessiondata)

0 commit comments

Comments
 (0)