From 5a79d4eaf0e06197d0cd9c8424cf065a66165a83 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Mon, 15 Apr 2024 07:16:22 -0700 Subject: [PATCH] ensure we delete log at correct path --- vilmo/batch.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vilmo/batch.go b/vilmo/batch.go index f140c311df..830516237b 100644 --- a/vilmo/batch.go +++ b/vilmo/batch.go @@ -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) } }