Commit 52075341 authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #2846 from hikenote/master

return template build error rather than log error
parents c6cef853 4bc4f77c
......@@ -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)
......
......@@ -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
}
......
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