Skip to content

Commit

Permalink
Non-nil timestamps on checkpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
  • Loading branch information
peterbroadhurst committed Jul 11, 2023
1 parent bc77ecb commit 3545306
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/persistence/dbmigration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ func (m *dbMigration) migrateEventStream(ctx context.Context, es *apitypes.Event
return err
}
if cp != nil && existingCP == nil {
// LevelDB didn't have timestamps in checkpoints
if cp.FirstCheckpoint == nil {
cp.FirstCheckpoint = fftypes.Now()
}
if cp.Time == nil {
cp.Time = cp.FirstCheckpoint
}
log.L(ctx).Infof("Writing checkpoint %s to target", cp.StreamID)
if err := m.target.WriteCheckpoint(ctx, cp); err != nil {
return err
Expand Down

0 comments on commit 3545306

Please sign in to comment.