publish node update and peer update on ingress gateway creation

This commit is contained in:
Matthew R Kasun
2022-01-22 15:34:01 -05:00
parent 60eab296fc
commit c1813c52e9
4 changed files with 31 additions and 23 deletions

View File

@@ -70,11 +70,11 @@ func MessageQueue(ctx context.Context, network string) {
if cfg.DebugOn {
ncutils.Log("subscribed to node updates for node " + cfg.Node.Name + " update/" + cfg.Node.ID)
}
if token := client.Subscribe("/update/peers/"+cfg.Node.ID, 0, UpdatePeers); token.Wait() && token.Error() != nil {
if token := client.Subscribe("update/peers/"+cfg.Node.ID, 0, UpdatePeers); token.Wait() && token.Error() != nil {
log.Fatal(token.Error())
}
if cfg.DebugOn {
ncutils.Log("subscribed to node updates for node " + cfg.Node.Name + " /update/peers/" + cfg.Node.ID)
ncutils.Log("subscribed to node updates for node " + cfg.Node.Name + " update/peers/" + cfg.Node.ID)
}
defer client.Disconnect(250)
go Checkin(ctx, &cfg, network)