1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 17:40:48 +00:00

Merge pull request #2846 from hikenote/master

return template build error rather than log error
This commit is contained in:
astaxie 2017-09-09 06:42:02 +08:00 committed by GitHub
commit 520753415f
2 changed files with 8 additions and 4 deletions

View File

@ -160,10 +160,13 @@ func (rp *Provider) SessionInit(maxlifetime int64, savePath string) error {
return nil, err
}
}
_, err = c.Do("SELECT", rp.dbNum)
if err != nil {
c.Close()
return nil, err
//some redis proxy such as twemproxy is not support select command
if rp.dbNum > 0 {
_, err = c.Do("SELECT", rp.dbNum)
if err != nil {
c.Close()
return nil, err
}
}
return c, err
}, rp.poolsize)

View File

@ -218,6 +218,7 @@ func BuildTemplate(dir string, files ...string) error {
}
if err != nil {
logs.Error("parse template err:", file, err)
return err
} else {
beeTemplates[file] = t
}