Skip to content

Commit

Permalink
Correctly log last successful heartbeat time.
Browse files Browse the repository at this point in the history
The agent mistakenly logged the last successful ping time instead, when an error occurred.
  • Loading branch information
philwo committed Aug 6, 2019
1 parent 9149a7b commit 246f54c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agent/agent_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (a *AgentWorker) Start(idleMonitor *IdleMonitor) error {
err := a.Heartbeat()
if err != nil {
// Get the last heartbeat time to the nearest microsecond
lastHeartbeat := time.Unix(atomic.LoadInt64(&a.lastPing), 0)
lastHeartbeat := time.Unix(atomic.LoadInt64(&a.lastHeartbeat), 0)

a.logger.Error("Failed to heartbeat %s. Will try again in %s. (Last successful was %v ago)",
err, heartbeatInterval, time.Now().Sub(lastHeartbeat))
Expand Down

0 comments on commit 246f54c

Please sign in to comment.