fix(server): shutdown logging fixes

This commit is contained in:
Torkel Ödegaard
2016-09-30 10:18:19 +02:00
parent 5ec86a9ef4
commit 24a25453f6
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ func listenToSystemSignals(server models.GrafanaServer) {
select {
case sig := <-signalChan:
server.Shutdown(0, fmt.Sprintf("system signal=%s", sig))
server.Shutdown(0, fmt.Sprintf("system signal: %s", sig))
case code = <-exitChan:
server.Shutdown(code, "startup error")
}
+2 -3
View File
@@ -103,13 +103,12 @@ func (g *GrafanaServerImpl) startHttpServer() {
}
func (g *GrafanaServerImpl) Shutdown(code int, reason string) {
log.Info("Shutting down", "code", code, "reason", reason)
g.log.Info("Shutting down", "code", code, "reason", reason)
g.shutdownFn()
err := g.childRoutines.Wait()
log.Info("Shutting down completed", "error", err)
g.log.Info("Shutting down completed", "reason", err)
log.Close()
os.Exit(code)
}