improve parseconfig
Showing
1 changed file
with
3 additions
and
1 deletions
| ... | @@ -180,12 +180,14 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App { | ... | @@ -180,12 +180,14 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App { |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | func Run() { | 182 | func Run() { |
| 183 | if AppConfigPath != path.Join(AppPath, "conf", "app.conf") { | ||
| 183 | err := ParseConfig() | 184 | err := ParseConfig() |
| 184 | if err != nil { | 185 | if err != nil { |
| 185 | if RunMode == "dev" { | 186 | if RunMode == "dev" { |
| 186 | Warn(err) | 187 | Warn(err) |
| 187 | } | 188 | } |
| 188 | } | 189 | } |
| 190 | } | ||
| 189 | if PprofOn { | 191 | if PprofOn { |
| 190 | BeeApp.Router(`/debug/pprof`, &ProfController{}) | 192 | BeeApp.Router(`/debug/pprof`, &ProfController{}) |
| 191 | BeeApp.Router(`/debug/pprof/:pp([\w]+)`, &ProfController{}) | 193 | BeeApp.Router(`/debug/pprof/:pp([\w]+)`, &ProfController{}) |
| ... | @@ -194,7 +196,7 @@ func Run() { | ... | @@ -194,7 +196,7 @@ func Run() { |
| 194 | GlobalSessions, _ = session.NewManager(SessionProvider, SessionName, SessionGCMaxLifetime, SessionSavePath) | 196 | GlobalSessions, _ = session.NewManager(SessionProvider, SessionName, SessionGCMaxLifetime, SessionSavePath) |
| 195 | go GlobalSessions.GC() | 197 | go GlobalSessions.GC() |
| 196 | } | 198 | } |
| 197 | err = BuildTemplate(ViewsPath) | 199 | err := BuildTemplate(ViewsPath) |
| 198 | if err != nil { | 200 | if err != nil { |
| 199 | if RunMode == "dev" { | 201 | if RunMode == "dev" { |
| 200 | Warn(err) | 202 | Warn(err) | ... | ... |
-
Please register or sign in to post a comment