1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-26 11:40:49 +00:00

Merge pull request #2539 from astaxie/revert-2421-develop

Revert "close mysql connection"
This commit is contained in:
astaxie 2017-03-29 09:57:54 +08:00 committed by GitHub
commit b18b94f03b

View File

@ -143,7 +143,6 @@ func (mp *Provider) SessionInit(maxlifetime int64, savePath string) error {
// SessionRead get mysql session by sid
func (mp *Provider) SessionRead(sid string) (session.Store, error) {
c := mp.connectInit()
defer c.Close()
row := c.QueryRow("select session_data from "+TableName+" where session_key=?", sid)
var sessiondata []byte
err := row.Scan(&sessiondata)
@ -177,7 +176,6 @@ func (mp *Provider) SessionExist(sid string) bool {
// SessionRegenerate generate new sid for mysql session
func (mp *Provider) SessionRegenerate(oldsid, sid string) (session.Store, error) {
c := mp.connectInit()
defer c.Close()
row := c.QueryRow("select session_data from "+TableName+" where session_key=?", oldsid)
var sessiondata []byte
err := row.Scan(&sessiondata)