Skip to content

Commit

Permalink
Add timeout to error send
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Feb 29, 2024
1 parent d5d960d commit 7848e80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion service/internal/proctelemetry/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ func InitPrometheusServer(registry *prometheus.Registry, address string, asyncEr
go func() {
defer serverWG.Done()
if serveErr := server.ListenAndServe(); serveErr != nil && !errors.Is(serveErr, http.ErrServerClosed) {
asyncErrorChannel <- serveErr
select {
case asyncErrorChannel <- serveErr:
case <-time.After(1 * time.Second):

Check warning on line 157 in service/internal/proctelemetry/config.go

View check run for this annotation

Codecov / codecov/patch

service/internal/proctelemetry/config.go#L155-L157

Added lines #L155 - L157 were not covered by tests
}
}
}()
return server
Expand Down

0 comments on commit 7848e80

Please sign in to comment.