Skip to content

Commit

Permalink
ensure we delete log at correct path
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-ogrady committed Apr 15, 2024
1 parent 88c4098 commit 5a79d4e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions vilmo/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,7 @@ func (b *Batch) Write() (ids.ID, error) {
return ids.Empty, fmt.Errorf("%w: could not close old batch", err)
}
if !b.reused {
preparedPath := filepath.Join(b.a.baseDir, strconv.FormatUint(preparedBatch, 10))
if err := os.Remove(preparedPath); err != nil {
if err := os.Remove(preparedReader.path); err != nil {
return ids.Empty, fmt.Errorf("%w: could not remove old batch", err)
}
}
Expand Down

0 comments on commit 5a79d4e

Please sign in to comment.