health: fix shutdown of health check server
This commit is contained in:
parent
9e2d6fb74e
commit
f6d160a7f8
@ -59,11 +59,10 @@ func (srv *Server) Listen(ctx context.Context, port int) error {
|
||||
|
||||
<-ctx.Done()
|
||||
|
||||
ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
|
||||
defer cancel()
|
||||
|
||||
g.Go(func() error {
|
||||
if err := hsrv.Shutdown(ctx); err != nil {
|
||||
shCtx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||
defer cancel()
|
||||
if err := hsrv.Shutdown(shCtx); err != nil {
|
||||
srv.log.Error("health check server shutdown failed", "err", err)
|
||||
return err
|
||||
}
|
||||
|
@ -196,7 +196,6 @@ func SetupSDK(ctx context.Context, cfg *TracerConfig) (shutdown TpShutdownFunc,
|
||||
}
|
||||
|
||||
func newOLTPExporter(ctx context.Context, cfg *TracerConfig) (sdktrace.SpanExporter, error) {
|
||||
|
||||
log := logger.Setup()
|
||||
|
||||
var tlsConfig *tls.Config
|
||||
|
Loading…
Reference in New Issue
Block a user