Added context.Context to stop and correctly stop metrics now

This commit is contained in:
Pablu23
2025-10-15 13:27:09 +02:00
parent f4ca559a26
commit e90c211d0f
5 changed files with 26 additions and 12 deletions

View File

@@ -64,8 +64,11 @@ func main() {
defer wg.Done()
<-sigs
log.Info().Msg("Stopping server")
server.Shutdown(context.Background())
pipeline.Stop()
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
server.Shutdown(ctx)
pipeline.Stop(ctx)
}()
if config.Server.Ssl.Enabled {