Skip to content

Commit

Permalink
shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com>
  • Loading branch information
chahatsagarmain committed Dec 3, 2024
1 parent a55d3a2 commit 01798c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/collector/app/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01798c7

Please sign in to comment.