1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 13:50:54 +00:00

improve parseconfig

This commit is contained in:
astaxie 2013-05-07 23:16:56 +08:00
parent c048efbbf8
commit 581bb65bbc

View File

@ -180,10 +180,12 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App {
} }
func Run() { func Run() {
err := ParseConfig() if AppConfigPath != path.Join(AppPath, "conf", "app.conf") {
if err != nil { err := ParseConfig()
if RunMode == "dev" { if err != nil {
Warn(err) if RunMode == "dev" {
Warn(err)
}
} }
} }
if PprofOn { if PprofOn {
@ -194,7 +196,7 @@ func Run() {
GlobalSessions, _ = session.NewManager(SessionProvider, SessionName, SessionGCMaxLifetime, SessionSavePath) GlobalSessions, _ = session.NewManager(SessionProvider, SessionName, SessionGCMaxLifetime, SessionSavePath)
go GlobalSessions.GC() go GlobalSessions.GC()
} }
err = BuildTemplate(ViewsPath) err := BuildTemplate(ViewsPath)
if err != nil { if err != nil {
if RunMode == "dev" { if RunMode == "dev" {
Warn(err) Warn(err)