crawler: Missing folder heal check per set (#10876)

This commit is contained in:
Klaus Post
2020-12-01 12:07:39 -08:00
committed by GitHub
parent 790833f3b2
commit e6ea5c2703
8 changed files with 487 additions and 159 deletions
+6
View File
@@ -43,6 +43,9 @@ type WalkDirOptions struct {
// Do a full recursive scan.
Recursive bool
// ReportNotFound will return errFileNotFound if all disks reports the BaseDir cannot be found.
ReportNotFound bool
// FilterPrefix will only return results with given prefix within folder.
// Should never contain a slash.
FilterPrefix string
@@ -98,6 +101,9 @@ func (s *xlStorage) WalkDir(ctx context.Context, opts WalkDirOptions, wr io.Writ
if err != errVolumeNotFound && err != errFileNotFound {
logger.LogIf(ctx, err)
}
if opts.ReportNotFound && err == errFileNotFound && current == opts.BaseDir {
return errFileNotFound
}
// Forward some errors?
return nil
}