From a99946937c3ae82c9b3b89baeb5f883abad92eae Mon Sep 17 00:00:00 2001 From: Phi Date: Wed, 29 Mar 2023 15:32:32 +0200 Subject: [PATCH] fix: log: Stop logging `file does not exists` Stop logging `file does not exists` errors when retrieving disk usage information. --- storage/paths/localstorage_cached.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/paths/localstorage_cached.go b/storage/paths/localstorage_cached.go index af43d1696..31e2528ff 100644 --- a/storage/paths/localstorage_cached.go +++ b/storage/paths/localstorage_cached.go @@ -1,6 +1,7 @@ package paths import ( + "os" "sync" "time" @@ -103,7 +104,9 @@ func (c *cachedLocalStorage) DiskUsage(path string) (int64, error) { go func() { du, err := c.base.DiskUsage(path) if err != nil { - log.Errorw("error getting disk usage", "path", path, "error", err) + if !os.IsNotExist(err) { + log.Errorw("error getting disk usage", "path", path, "error", err) + } } resCh <- diskUsageResult{ usage: du,