// stop stops running gRPC server gracefully.
stop stops running gRPC server gracefully.
// stop stops running gRPC server gracefully .
func (s *Server) stop() {
	ch := make(chan struct{})
	go func() {
		s.logger.Info("gracefulStop is running")
		s.grpcServer.GracefulStop()
		close(ch)
	}()
	select {
	case <-ch:
		s.logger.Info("gracefulStop completed before timing out")
	case <-time.After(s.gracePeriod):
		s.logger.Info("force server to stop")
		s.grpcServer.Stop()
	}
}
func ( s * Server ) stop ( ) { ch := make ( chan struct { } ) go func ( ) { s . logger . Info ( " " ) s . grpcServer . GracefulStop ( ) close ( ch ) } ( ) select { case <- ch : s . logger . Info ( " " ) case <- time . After ( s . gracePeriod ) : s . logger . Info ( " " ) s . grpcServer . Stop ( ) } }
stop stops running gRPC server gracefully.
stop stops running gRPC server gracefully .