From 01798c7cb3eb7f841041dada3e263a77665b7a42 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Tue, 3 Dec 2024 19:01:34 +0530 Subject: [PATCH] shutdown Signed-off-by: chahatsagarmain --- cmd/collector/app/collector.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/collector/app/collector.go b/cmd/collector/app/collector.go index b601b6e42e8..d830b152462 100644 --- a/cmd/collector/app/collector.go +++ b/cmd/collector/app/collector.go @@ -161,11 +161,11 @@ func (c *Collector) Close() error { // Stop HTTP server if c.hServer != nil { - // timeout, cancel := context.WithTimeout(context.Background(), 5*time.Second) - if err := c.hServer.Close(); err != nil { + timeout, cancel := context.WithTimeout(context.Background(), 5*time.Second) + if err := c.hServer.Shutdown(timeout); err != nil { c.logger.Fatal("failed to stop the main HTTP server", zap.Error(err)) } - // defer cancel() + defer cancel() } // Stop Zipkin receiver