mirror of
https://github.com/astaxie/beego.git
synced 2024-11-05 01:40:55 +00:00
improve parseconfig
This commit is contained in:
parent
c048efbbf8
commit
581bb65bbc
4
beego.go
4
beego.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user