Skip to content

Agent Mesh

reconnect boostrap again

Antonio Ojea017474ac88df
diff --git a/cmd/sam-node/node.go b/cmd/sam-node/node.go
index c29cab20..056d0d13 100644
--- a/cmd/sam-node/node.go
+++ b/cmd/sam-node/node.go
@@ -524,7 +524,11 @@ func (n *SamNode) startConnectionMonitor(ctx context.Context, bootstrapDuration,
}
if reconnected {
- logger.Infof("[Monitor] Reconnected successfully. Reproviding services to DHT...")
+ logger.Infof("[Monitor] Reconnected successfully. Bootstrapping DHT...")
+ if err := n.DHT.Bootstrap(ctx); err != nil {
+ logger.Warnf("[DHT] Failed to trigger DHT bootstrap on reconnect: %v", err)
+ }
+ logger.Infof("[Monitor] Reproviding services to DHT...")
n.services.ReprovideAll(ctx)
consecutiveFailures = 0
continue