mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-11 15:44:52 +08:00
merge develop
This commit is contained in:
commit
a0519cc16a
2 changed files with 8 additions and 3 deletions
9
main.go
9
main.go
|
@ -151,9 +151,14 @@ func startControllers(wg *sync.WaitGroup, ctx context.Context) {
|
||||||
// Should we be using a context vice a waitgroup????????????
|
// Should we be using a context vice a waitgroup????????????
|
||||||
func runMessageQueue(wg *sync.WaitGroup, ctx context.Context) {
|
func runMessageQueue(wg *sync.WaitGroup, ctx context.Context) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
brokerHost, secure := servercfg.GetMessageQueueEndpoint()
|
brokerHost, _ := servercfg.GetMessageQueueEndpoint()
|
||||||
logger.Log(0, "connecting to mq broker at", brokerHost, "with TLS?", fmt.Sprintf("%v", secure))
|
logger.Log(0, "connecting to mq broker at", brokerHost)
|
||||||
mq.SetupMQTT()
|
mq.SetupMQTT()
|
||||||
|
if mq.IsConnected() {
|
||||||
|
logger.Log(0, "connected to MQ Broker")
|
||||||
|
} else {
|
||||||
|
logger.FatalLog("error connecting to MQ Broker")
|
||||||
|
}
|
||||||
defer mq.CloseClient()
|
defer mq.CloseClient()
|
||||||
go mq.Keepalive(ctx)
|
go mq.Keepalive(ctx)
|
||||||
go func() {
|
go func() {
|
||||||
|
|
|
@ -402,7 +402,7 @@ func getCustomDNS(network string) []models.DNSUpdate {
|
||||||
func sendPeers() {
|
func sendPeers() {
|
||||||
|
|
||||||
hosts, err := logic.GetAllHosts()
|
hosts, err := logic.GetAllHosts()
|
||||||
if err != nil {
|
if err != nil && len(hosts) > 0 {
|
||||||
logger.Log(1, "error retrieving networks for keepalive", err.Error())
|
logger.Log(1, "error retrieving networks for keepalive", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue