mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-04 20:06:12 +02:00
Merge pull request #17006 from sujalshah-bit/fix_wal_dir_bug
wal: ignore os.ErrNotExist errors in DirSize during WAL size calculation
This commit is contained in:
commit
291e2ae090
@ -22,6 +22,10 @@ func DirSize(dir string) (int64, error) {
|
||||
var size int64
|
||||
err := filepath.Walk(dir, func(_ string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
// Ignore missing files that may have been deleted during the walk.
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
if !info.IsDir() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user