Skip to content

Commit

Permalink
fix: tarlog migration fails on new installs
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Oct 20, 2024
1 parent 39f3fe9 commit 5617f3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/logstore/tarmigrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package logstore
import (
"archive/tar"
"compress/gzip"
"errors"
"fmt"
"io"
"os"
Expand All @@ -15,8 +16,10 @@ import (

func MigrateTarLogsInDir(ls *LogStore, dir string) {
files, err := os.ReadDir(dir)
if err != nil {
zap.L().Fatal("failed to read directory", zap.String("dir", dir), zap.Error(err))
if errors.Is(err, os.ErrNotExist) {
return
} else if err != nil {
zap.L().Warn("tarlog migration failed to read directory", zap.String("dir", dir), zap.Error(err))
}

for _, file := range files {
Expand Down

0 comments on commit 5617f3f

Please sign in to comment.