Skip to content

Commit 8978836

Browse files
m-Peterpeterargue
andauthored
Wait until metrics ready channel is closed
Co-authored-by: Peter Argue <[email protected]>
1 parent b0ee1d1 commit 8978836

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bootstrap/bootstrap.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ func (b *Bootstrap) StartMetricsServer(ctx context.Context) error {
374374

375375
ictx, errCh := irrecoverable.WithSignaler(ctx)
376376
b.metrics.Start(ictx)
377-
<-b.metrics.Ready()
377+
if err := util.WaitClosed(ctx, b.metrics.Ready()); err != nil {
378+
return fmt.Errorf("failed to start metrics server: %w", err)
379+
}
378380
select {
379381
case err := <-errCh:
380382
// there might be an error already if the startup failed

0 commit comments

Comments
 (0)