Skip to content

Commit

Permalink
fix: change heartbeat to use maximum received timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-bahjati committed Oct 16, 2023
1 parent 4b9d386 commit 4693b45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ func ReceiveMessages(channel chan *vaa.VAA, heartbeat *Heartbeat, networkID stri
// Send message on channel, increment counter, and update heartbeat
channel <- vaa
messagesMetric.Inc()
heartbeat.Timestamp = vaa.Timestamp.Unix()
if vaa.Timestamp.Unix() > heartbeat.Timestamp {
heartbeat.Timestamp = vaa.Timestamp.Unix()
}

log.Debug().Str("id", vaa.MessageID()).Msg("Received message")
}
Expand Down

0 comments on commit 4693b45

Please sign in to comment.