Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
ssd04 committed Aug 7, 2024
1 parent 7fbca4c commit d6de3c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion process/dataPool.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,19 @@ func (bp *dataPool) getCheckpointData(checkpointKey string) (*data.BlockCheckpoi
return checkpoint, nil
}

func deepCopyMap(originalMap map[uint32]uint64) map[uint32]uint64 {
newMap := make(map[uint32]uint64)

for key, value := range originalMap {
newMap[key] = value
}

return newMap
}

func (bp *dataPool) saveLastSoftCheckpoint() error {
bp.mutMap.RLock()
softCheckpointMap := bp.softCheckpointMap
softCheckpointMap := deepCopyMap(bp.softCheckpointMap)
bp.mutMap.RUnlock()

softCheckpoint := &data.BlockCheckpoint{}
Expand Down
2 changes: 1 addition & 1 deletion process/publisherHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (ph *publisherHandler) updatePublishCheckpoint() {

func (ph *publisherHandler) handleLastCheckpointOnInit() error {
if ph.resetCheckpoints {
log.Debug("did not checked last publisher checkpoint on init")
log.Debug("did not check last publisher checkpoint on init")
return nil
}

Expand Down

0 comments on commit d6de3c3

Please sign in to comment.