mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-21 07:46:04 +08:00
fix typo
This commit is contained in:
parent
84d9faeb3f
commit
4854cb2db9
3
mq/mq.go
3
mq/mq.go
|
@ -156,11 +156,12 @@ func SetupMQTT() mqtt.Client {
|
||||||
opts := mqtt.NewClientOptions()
|
opts := mqtt.NewClientOptions()
|
||||||
broker := servercfg.GetMessageQueueEndpoint()
|
broker := servercfg.GetMessageQueueEndpoint()
|
||||||
opts.AddBroker(broker)
|
opts.AddBroker(broker)
|
||||||
|
client := mqtt.NewClient(opts)
|
||||||
tperiod := time.Now().Add(10 * time.Second)
|
tperiod := time.Now().Add(10 * time.Second)
|
||||||
for {
|
for {
|
||||||
if token := client.Connect(); token.Wait() && token.Error() != nil {
|
if token := client.Connect(); token.Wait() && token.Error() != nil {
|
||||||
logger.Log(2, "unable to connect to broker, retrying ...")
|
logger.Log(2, "unable to connect to broker, retrying ...")
|
||||||
if time.Now().Afer(tperiod) {
|
if time.Now().After(tperiod) {
|
||||||
log.Fatal(0, "could not connect to broker, exiting ...", token.Error())
|
log.Fatal(0, "could not connect to broker, exiting ...", token.Error())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -75,7 +75,7 @@ func SetupMQTT(cfg *config.ClientConfig) mqtt.Client {
|
||||||
for {
|
for {
|
||||||
if token := client.Connect(); token.Wait() && token.Error() != nil {
|
if token := client.Connect(); token.Wait() && token.Error() != nil {
|
||||||
logger.Log(2, "unable to connect to broker, retrying ...")
|
logger.Log(2, "unable to connect to broker, retrying ...")
|
||||||
if time.Now().Afer(tperiod) {
|
if time.Now().After(tperiod) {
|
||||||
log.Fatal(0, "could not connect to broker, exiting ...", token.Error())
|
log.Fatal(0, "could not connect to broker, exiting ...", token.Error())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue