Skip to content

Commit

Permalink
Log machine id and message values instead of ptrs in handshake handler
Browse files Browse the repository at this point in the history
  • Loading branch information
kthomas committed Jan 9, 2024
1 parent 3388c80 commit 3d13e78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nex-node/agentcomms.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ func handleHandshake(mgr *MachineManager) func(m *nats.Msg) {
var shake agentapi.HandshakeRequest
err := json.Unmarshal(m.Data, &shake)
if err != nil {
mgr.log.WithField("vmid", shake.MachineId).WithField("message", shake.Message).Error("Failed to handle agent handshake")
mgr.log.WithField("vmid", *shake.MachineId).WithField("message", *shake.Message).Error("Failed to handle agent handshake")
return
}

now := time.Now().UTC()
mgr.handshakes[*shake.MachineId] = now.Format(time.RFC3339)

mgr.log.WithField("vmid", shake.MachineId).WithField("message", shake.Message).Info("Received agent handshake")
mgr.log.WithField("vmid", *shake.MachineId).WithField("message", *shake.Message).Info("Received agent handshake")
err = m.Respond([]byte("OK"))
if err != nil {
mgr.log.WithError(err).Error("Failed to reply to agent handshake")
Expand Down

0 comments on commit 3d13e78

Please sign in to comment.