func (g *Gateway) Shutdown() error {
	logger.Debugf("Stop database gateway")

	if g.raft != nil {
		err := g.raft.Shutdown()
		if err != nil {
			return errors.Wrap(err, "Failed to shutdown raft")
		}
	}

	if g.server != nil {
		g.Sync()
		g.server.Close()

		// Unset the memory dial, since Shutdown() is also called for
		// switching between in-memory and network mode.
		g.memoryDial = nil
	}

	return nil
}
func (g *Gateway) Shutdown() error {
	logger.Debugf("Stop database gateway")

	if g.raft != nil {
		err := g.raft.Shutdown()
		if err != nil {
			return errors.Wrap(err, "Failed to shutdown raft")
		}
	}

	if g.server != nil {
		g.Sync()
		g.server.Close()

		
		
		g.memoryDial = nil
	}

	return nil
}
func ( g * Gateway ) Shutdown ( ) error { logger . Debugf ( " " ) if g . raft != nil { err := g . raft . Shutdown ( ) if err != nil { return errors . Wrap ( err , " " ) } } if g . server != nil { g . Sync ( ) g . server . Close ( ) // Unset the memory dial, since Shutdown() is also called for // switching between in-memory and network mode. g . memoryDial = nil } return nil }
// Shutdown this gateway, stopping the gRPC server and possibly the raft factory.
Shutdown this gateway stopping the gRPC server and possibly the raft factory .