INNER CODE UNIT · Go

gracefulShutdownHttpServer

datastax-archive/kaskada · wren/main.go:410

func gracefulShutdownHttpServer(ctx context.Context, server *http.Server, name string) {
	if server != nil {
		log.Info().Msgf("initiating graceful shutdown of the %s server", name)
		if err := server.Shutdown(ctx); err != nil {
			log.Error().Err(err).Msgf("error shutting down the %s server", name)
		} else {
			log.Info().Msgf("graceful shutdown of the %s server is complete", name)
		}
	}
}

func gracefulStopGrpcServer(server *grpc.Server, name string) {
	if server != nil {
		log.Info().Msgf("initiating graceful stop of the %s server", name)
		server.GracefulStop()
		log.Info().Msgf("graceful stop of the %s server is complete", name)
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…