Skip to content

Commit

Permalink
Ensure that the timestamp is only used if newer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Rouse committed Dec 5, 2023
1 parent 71b5b0e commit c1a308b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/client/client_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,11 @@ func recvExpectedChunked(client proto.ElasticAgent_CheckinV2Client, chunk bool)
// first message in batch
initialMsg = msg
} else if initialMsg.UnitsTimestamp.AsTime() != msg.UnitsTimestamp.AsTime() {
// only used if the new timestamp is newer
if initialMsg.UnitsTimestamp.AsTime().After(msg.UnitsTimestamp.AsTime()) {
// not newer so we ignore the message
continue
}
// different batch; restart
initialMsg = msg
}
Expand Down

0 comments on commit c1a308b

Please sign in to comment.