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:
Anders Brander 2020-02-05 23:05:37 +01:00 committed by GitHub
parent 491751f4fc
commit 3ed5370439
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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")
}

View file

@ -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")