func Shutdown() {
	logrus.Infof("lile: Gracefully shutting down gRPC and Prometheus")
	if service.Registry != nil {
		service.Registry.DeRegister(service)
	}
	service.GRPCServer.GracefulStop()
	ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second)
	defer cancel()
	if err := service.PrometheusServer.Shutdown(ctx); err != nil {
		logrus.Infof("Timeout during shutdown of metrics server. Error: %v", err)
	}
}
Shutdown gracefully shuts down the gRPC and metrics servers
package lile
import (
	"context"
	"net"
	"net/http"
	"time"
	grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
	grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"github.com/sirupsen/logrus"
	"google.golang.org/grpc"
)
func Run() error {
	if service.Registry != nil {
		service.Registry.Register(service)
	}
	startPrometheusServer()
	err := ServeGRPC()
	if service.Registry != nil {
		service.Registry.DeRegister(service)
	}
	return err
}
func ServeGRPC() error {
	var err error
	service.ServiceListener, err = net.Listen("tcp", service.Config.Address())
	if err != nil {
		return err
	}
	logrus.Infof("Serving gRPC on %s", service.Config.Address())
	return createGrpcServer().Serve(service.ServiceListener)
}