Skip to content

Commit

Permalink
Fix: http server graceful shutdown (#88)
Browse files Browse the repository at this point in the history
Co-authored-by: Ivaylo Papratilov <[email protected]>
  • Loading branch information
Ivaka and Ivaka authored Jan 4, 2024
1 parent ed24583 commit 3995a44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func run(log logrus.FieldLogger) error {
}()

go func() {
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, context.Canceled) {
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
err = fmt.Errorf("starting http server: %w", err)
log.Error(err.Error())
errc <- err
Expand Down

0 comments on commit 3995a44

Please sign in to comment.