Skip to content

Commit

Permalink
filelist: skip checking filepath stat info on service startup
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Jun 9, 2021
1 parent 70c24df commit b029a9e
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pkg/filelist/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"io/fs"
"os"
"path/filepath"

"github.com/moov-io/ach"
Expand All @@ -20,17 +19,10 @@ func newFilesystemLister(sourceID string, cfg *service.FilesystemConfig) (*files
if cfg == nil {
return nil, errors.New("missing FilesystemConfig")
}
ls := &filesystemLister{
return &filesystemLister{
sourceID: sourceID,
}
for i := range cfg.Paths {
if fd, err := os.Stat(cfg.Paths[i]); err == nil && fd.IsDir() {
ls.dirs = append(ls.dirs, cfg.Paths[i])
} else {
return nil, fmt.Errorf("error reading %s: %v", cfg.Paths[i], err)
}
}
return ls, nil
dirs: cfg.Paths,
}, nil
}

func (ls *filesystemLister) SourceID() string {
Expand Down

0 comments on commit b029a9e

Please sign in to comment.