Browse Source

set proxy action based on proxy status

Abhishek Kondur 2 years ago
parent
commit
45ea3be347
1 changed files with 6 additions and 1 deletions
  1. 6 1
      mq/publishers.go

+ 6 - 1
mq/publishers.go

@@ -93,7 +93,12 @@ func PublishSingleHostPeerUpdate(ctx context.Context, host *models.Host, deleted
 		return err
 	}
 	proxyUpdate.Server = servercfg.GetServer()
-	proxyUpdate.Action = models.ProxyUpdate
+	if host.ProxyEnabled {
+		proxyUpdate.Action = models.ProxyUpdate
+	} else {
+		proxyUpdate.Action = models.NoProxy
+	}
+
 	peerUpdate.ProxyUpdate = proxyUpdate
 
 	data, err := json.Marshal(&peerUpdate)