Skip to content

Commit 14e8ef9

Browse files
authored
Flip RUN_MODE detection in router (#13768)
Missed that part in #13765. It's already in the 1.13 backport so this forward-ports that change again.
1 parent bc455ed commit 14e8ef9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

routers/init.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ import (
4343
)
4444

4545
func checkRunMode() {
46-
switch setting.Cfg.Section("").Key("RUN_MODE").String() {
47-
case "prod":
46+
switch setting.RunMode {
47+
case "dev":
48+
git.Debug = true
49+
case "test":
50+
git.Debug = true
51+
default:
4852
macaron.Env = macaron.PROD
4953
macaron.ColorLog = false
5054
setting.ProdMode = true
51-
default:
52-
git.Debug = true
5355
}
5456
log.Info("Run Mode: %s", strings.Title(macaron.Env))
5557
}

0 commit comments

Comments
 (0)