mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-06 05:04:27 +08:00
add debug log of mq client id
This commit is contained in:
parent
c8e65f4820
commit
29c5d6ceca
1 changed files with 1 additions and 0 deletions
1
mq/mq.go
1
mq/mq.go
|
@ -70,6 +70,7 @@ func SetupMQTT() {
|
|||
|
||||
opts := mqtt.NewClientOptions()
|
||||
setMqOptions(servercfg.GetMqUserName(), servercfg.GetMqPassword(), opts)
|
||||
logger.Log(0, "Mq Client Connecting with Random ID: ", opts.ClientID)
|
||||
opts.SetOnConnectHandler(func(client mqtt.Client) {
|
||||
serverName := servercfg.GetServer()
|
||||
if token := client.Subscribe(fmt.Sprintf("update/%s/#", serverName), 0, mqtt.MessageHandler(UpdateNode)); token.WaitTimeout(MQ_TIMEOUT*time.Second) && token.Error() != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue