Skip to content

Commit

Permalink
format heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Nov 16, 2024
1 parent b94494f commit 7e7a7db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,13 @@ func (a *Agent) heartbeatRoutine() {
for {
select {
case <-ticker.C:
log.Printf("Sending heartbeat to proxy")
heartbeat := payloads.AgentHeartbeatJson{
Type: payloads.AgentHeartbeatJsonTypeClientHeartbeat,
Timestamp: []time.Time{time.Now()}[0],
Type: payloads.AgentHeartbeatJsonTypeAgentHeartbeat,
Timestamp: time.Now().Format(time.RFC3339),
}

log.Printf("Sending heartbeat to proxy: %+v", heartbeat)

data, err := json.Marshal(heartbeat)
if err != nil {
log.Printf("Error marshaling heartbeat: %v", err)
Expand Down
8 changes: 4 additions & 4 deletions pkg/payloads/agent_heartbeat_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e7a7db

Please sign in to comment.