Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
VihasMakwana committed Oct 22, 2024
1 parent d00b376 commit 2936928
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/stanza/fileconsumer/internal/tracker/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ func (t *fileTracker) SyncOffsets() {
archiveReadIndex := t.archiveIndex - 1 // try loading most recently written index and iterate backwards
for i := 0; i < t.pollsToArchive; i++ {
newFound := false
data, _ := t.readArchive(archiveReadIndex)
data, err := t.readArchive(archiveReadIndex)
if err != nil {
t.set.Logger.Error("error while opening archive", zap.Error(err))
continue
}
for _, v := range t.currentPollFiles.Get() {
if v.IsNew() {
newFound = true
Expand All @@ -212,7 +216,10 @@ func (t *fileTracker) SyncOffsets() {
// Just exit to save time.
break
}
t.updateArchive(archiveReadIndex, data)
if err := t.updateArchive(archiveReadIndex, data); err != nil {
t.set.Logger.Error("error while opening archive", zap.Error(err))
continue
}

archiveReadIndex = (archiveReadIndex - 1) % t.pollsToArchive
}
Expand Down

0 comments on commit 2936928

Please sign in to comment.