Skip to content

Commit

Permalink
Move shutdown log msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps committed Oct 5, 2022
1 parent 0556496 commit 23af915
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/flipt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ func run(ctx context.Context, logger *zap.Logger) error {
grpcServer = grpc.NewServer(grpcOpts...)

// register grpcServer graceful stop on shutdown
shutdownFuncs = append(shutdownFuncs, func(context.Context) { grpcServer.GracefulStop() })
shutdownFuncs = append(shutdownFuncs, func(context.Context) {
grpcServer.GracefulStop()
logger.Info("grpc server shutdown gracefully")
})

pb.RegisterFliptServer(grpcServer, srv)
grpc_prometheus.EnableHandlingTimeHistogram()
Expand Down Expand Up @@ -660,7 +663,10 @@ func run(ctx context.Context, logger *zap.Logger) error {
}

// register httpServer graceful stop on shutdown
shutdownFuncs = append(shutdownFuncs, func(ctx context.Context) { _ = httpServer.Shutdown(ctx) })
shutdownFuncs = append(shutdownFuncs, func(ctx context.Context) {
_ = httpServer.Shutdown(ctx)
logger.Info("http server shutdown gracefully")
})

logger.Debug("starting http server")

Expand Down Expand Up @@ -708,7 +714,6 @@ func run(ctx context.Context, logger *zap.Logger) error {
return fmt.Errorf("http server: %w", err)
}

logger.Info("server shutdown gracefully")
return nil
})

Expand Down

0 comments on commit 23af915

Please sign in to comment.