1
0
mirror of https://github.com/astaxie/beego.git synced 2024-07-01 00:44:13 +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,12 +180,14 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App {
} }
func Run() { func Run() {
if AppConfigPath != path.Join(AppPath, "conf", "app.conf") {
err := ParseConfig() err := ParseConfig()
if err != nil { if err != nil {
if RunMode == "dev" { if RunMode == "dev" {
Warn(err) Warn(err)
} }
} }
}
if PprofOn { if PprofOn {
BeeApp.Router(`/debug/pprof`, &ProfController{}) BeeApp.Router(`/debug/pprof`, &ProfController{})
BeeApp.Router(`/debug/pprof/:pp([\w]+)`, &ProfController{}) BeeApp.Router(`/debug/pprof/:pp([\w]+)`, &ProfController{})
@ -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)