root: restart gunicorn on configuration changes
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
parent
969ec188a7
commit
d3ef158360
|
@ -97,6 +97,17 @@ var rootCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
go web.RunMetricsServer()
|
go web.RunMetricsServer()
|
||||||
go attemptStartBackend(g)
|
go attemptStartBackend(g)
|
||||||
|
|
||||||
|
w, err := config.WatchChanges(func() {
|
||||||
|
g.Restart()
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
l.WithError(err).Warning("failed to start watching for configuration changes, no automatic update will be done")
|
||||||
|
}
|
||||||
|
if w != nil {
|
||||||
|
defer w.Close()
|
||||||
|
}
|
||||||
|
|
||||||
ws.Start()
|
ws.Start()
|
||||||
<-ex
|
<-ex
|
||||||
running = false
|
running = false
|
||||||
|
|
Reference in New Issue