improve parseconfig
Showing
1 changed file
with
7 additions
and
5 deletions
| ... | @@ -180,10 +180,12 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App { | ... | @@ -180,10 +180,12 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App { |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | func Run() { | 182 | func Run() { |
| 183 | err := ParseConfig() | 183 | if AppConfigPath != path.Join(AppPath, "conf", "app.conf") { |
| 184 | if err != nil { | 184 | err := ParseConfig() |
| 185 | if RunMode == "dev" { | 185 | if err != nil { |
| 186 | Warn(err) | 186 | if RunMode == "dev" { |
| 187 | Warn(err) | ||
| 188 | } | ||
| 187 | } | 189 | } |
| 188 | } | 190 | } |
| 189 | if PprofOn { | 191 | if PprofOn { |
| ... | @@ -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