Skip to content

Commit 7175bc2

Browse files
author
Thomas Delbende
committed
fix: don't log "error" when stopping http server
1 parent 8aecb8c commit 7175bc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

agent/agent.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"io"
2727
"math"
2828
"net"
29+
"net/http"
2930
"net/url"
3031
"os"
3132
"path/filepath"
@@ -1375,7 +1376,7 @@ func (a *agent) run(ctx context.Context, sighupChan chan os.Signal) { //nolint:m
13751376
go func() {
13761377
defer lateTasks.Done()
13771378

1378-
if err := api.Run(lateCtx); err != nil {
1379+
if err := api.Run(lateCtx); err != nil && !errors.Is(err, http.ErrServerClosed) {
13791380
logger.V(1).Printf("Error while stopping api: %v", err)
13801381
}
13811382
}()

0 commit comments

Comments
 (0)