From 0c22448e5f74de4ce9ed7086c4c6f8712534ae2b Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Tue, 20 May 2025 15:29:23 -0400 Subject: [PATCH] Avoid spurious file not found errors loading STH dir if an STH is concurrently deleted --- monitor/sthdir.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monitor/sthdir.go b/monitor/sthdir.go index b6407ad..f327a16 100644 --- a/monitor/sthdir.go +++ b/monitor/sthdir.go @@ -47,7 +47,9 @@ func loadSTHsFromDir(dirPath string) ([]*StoredSTH, error) { continue } sth, err := readSTHFile(filepath.Join(dirPath, filename)) - if err != nil { + if errors.Is(err, fs.ErrNotExist) { + continue + } else if err != nil { return nil, err } sths = append(sths, sth)