fix(archive): log swallowed walkdir errors during transmittal indexing
indexTransmittalFolder silently dropped per-entry walk errors (`_ = err`), so a permission or filesystem error on one file vanished without a trace — the operator saw "missing from the index" with no clue why. Log it (the slog.Warn the comment had already drafted) and keep indexing the rest. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1402864c4c
commit
4f021d8abc
1 changed files with 4 additions and 2 deletions
|
|
@ -120,8 +120,10 @@ func walkAndIndex(idx *Index, fsRoot, dirAbs, serverDir string) error {
|
|||
func indexTransmittalFolder(idx *Index, fsRoot, folderAbs, folderServerPath, date string) error {
|
||||
return filepath.WalkDir(folderAbs, func(path string, d os.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
// Log the error but continue indexing other files
|
||||
_ = err // would log here: slog.Warn("walkdir error", "path", path, "err", err)
|
||||
// Log and continue indexing the rest of the folder — a
|
||||
// permission or FS error on one entry shouldn't abort the
|
||||
// whole transmittal index or vanish without a trace.
|
||||
slog.Warn("transmittal index: walkdir error", "path", path, "err", err)
|
||||
return nil
|
||||
}
|
||||
if d.IsDir() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue