Skip to content

Commit

Permalink
Fix error log when no logs exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Sep 12, 2023
1 parent 6d4f8fa commit 4b7fb93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/base/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package base

import (
"context"
"errors"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -31,7 +32,9 @@ func logCleaner(_ context.Context, _ *modules.Task) error {
filepath.Join(dataroot.Root().Path, logFileDir),
func(path string, info os.FileInfo, err error) error {
if err != nil {
log.Warningf("core: failed to access %s while deleting old log files: %s", path, err)
if !errors.Is(err, os.ErrNotExist) {
log.Warningf("core: failed to access %s while deleting old log files: %s", path, err)
}
return nil
}

Expand Down

0 comments on commit 4b7fb93

Please sign in to comment.