internal: use runserver when debug for code reload
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
b8d86bc482
commit
1a9ace6f9d
|
@ -9,6 +9,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
"goauthentik.io/internal/config"
|
||||||
"goauthentik.io/internal/outpost/ak"
|
"goauthentik.io/internal/outpost/ak"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -38,6 +39,10 @@ func NewGoUnicorn() *GoUnicorn {
|
||||||
func (g *GoUnicorn) initCmd() {
|
func (g *GoUnicorn) initCmd() {
|
||||||
command := "gunicorn"
|
command := "gunicorn"
|
||||||
args := []string{"-c", "./lifecycle/gunicorn.conf.py", "authentik.root.asgi.app:application"}
|
args := []string{"-c", "./lifecycle/gunicorn.conf.py", "authentik.root.asgi.app:application"}
|
||||||
|
if config.G.Debug {
|
||||||
|
command = "./manage.py"
|
||||||
|
args = []string{"runserver"}
|
||||||
|
}
|
||||||
g.log.WithField("args", args).WithField("cmd", command).Debug("Starting gunicorn")
|
g.log.WithField("args", args).WithField("cmd", command).Debug("Starting gunicorn")
|
||||||
g.p = exec.Command(command, args...)
|
g.p = exec.Command(command, args...)
|
||||||
g.p.Env = os.Environ()
|
g.p.Env = os.Environ()
|
||||||
|
|
Reference in a new issue