Do not print starting web server before starting web server. (#240)
Thnigs can go wrong and abort in server.Start() before the web server is started. This commit will move the log message to where the webserver is started to avoid confusing the user.
This commit is contained in:
parent
491751f4fc
commit
3ed5370439
|
@ -106,8 +106,6 @@ func startAction(ctx *cli.Context) error {
|
|||
}
|
||||
}
|
||||
|
||||
log.Infof("starting web server at %s:%d", conf.HttpServerHost(), conf.HttpServerPort())
|
||||
|
||||
if conf.ReadOnly() {
|
||||
log.Infof("read-only mode enabled")
|
||||
}
|
||||
|
|
|
@ -40,6 +40,8 @@ func Start(ctx context.Context, conf *config.Config) {
|
|||
}
|
||||
|
||||
go func() {
|
||||
log.Infof("starting web server at %s", server.Addr)
|
||||
|
||||
if err := server.ListenAndServe(); err != nil {
|
||||
if err == http.ErrServerClosed {
|
||||
log.Info("web server shutdown complete")
|
||||
|
|
Loading…
Reference in a new issue