Skip to content

Commit

Permalink
Add error if concatenating unsorted mcap files
Browse files Browse the repository at this point in the history
  • Loading branch information
kevswims committed Nov 14, 2023
1 parent 63c8342 commit 2d58f04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/cli/mcap/cmd/concat.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ func (m *mcapConcatenator) concatenateInputs(w io.Writer, inputs []namedReader)
return fmt.Errorf("error on input %s: %w", inputName, err)
}

if newMessage.LogTime < timestampOffset {
return fmt.Errorf("timestamp %d is less than offset %d, sort input files before concatenating", newMessage.LogTime, timestampOffset)
}

newMessage.LogTime -= timestampOffset
lastTimestamp = newMessage.LogTime

Expand Down

0 comments on commit 2d58f04

Please sign in to comment.