mirror of
https://github.com/gravitl/netmaker.git
synced 2025-12-24 13:28:22 +08:00
@@ -292,7 +292,7 @@ func PushSyncDNS(dnsEntries []models.DNSEntry) error {
|
||||
if mqclient == nil || !mqclient.IsConnectionOpen() {
|
||||
return errors.New("cannot publish ... mqclient not connected")
|
||||
}
|
||||
if token := mqclient.Publish(fmt.Sprintf("host/dns/sync/%s", dnsEntries[0].Network), 0, true, data); !token.WaitTimeout(MQ_TIMEOUT*time.Second) || token.Error() != nil {
|
||||
if token := mqclient.Publish(fmt.Sprintf("host/dns/sync/%s/%s", dnsEntries[0].Network, servercfg.GetServer()), 0, true, data); !token.WaitTimeout(MQ_TIMEOUT*time.Second) || token.Error() != nil {
|
||||
var err error
|
||||
if token.Error() == nil {
|
||||
err = errors.New("connection timeout")
|
||||
@@ -301,5 +301,17 @@ func PushSyncDNS(dnsEntries []models.DNSEntry) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
if !servercfg.DeployedByOperator() {
|
||||
if token := mqclient.Publish(fmt.Sprintf("host/dns/sync/%s", dnsEntries[0].Network), 0, true, data); !token.WaitTimeout(MQ_TIMEOUT*time.Second) || token.Error() != nil {
|
||||
var err error
|
||||
if token.Error() == nil {
|
||||
err = errors.New("connection timeout")
|
||||
} else {
|
||||
err = token.Error()
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user