From dc767b65dfe4007bb4fa702f2c3977e6cfbe96f7 Mon Sep 17 00:00:00 2001 From: Norman <53300940@qq.com> Date: Tue, 14 Jan 2014 19:54:32 +0800 Subject: [PATCH] Update SessionExist to close the db connection close the mysql connection --- session/sess_mysql.go | 1 + 1 file changed, 1 insertion(+) diff --git a/session/sess_mysql.go b/session/sess_mysql.go index 3b0c6f3f..7bad9e4a 100644 --- a/session/sess_mysql.go +++ b/session/sess_mysql.go @@ -115,6 +115,7 @@ func (mp *MysqlProvider) SessionRead(sid string) (SessionStore, error) { func (mp *MysqlProvider) SessionExist(sid string) bool { c := mp.connectInit() + defer c.Close() row := c.QueryRow("select session_data from session where session_key=?", sid) var sessiondata []byte err := row.Scan(&sessiondata)