Fix error log when no logs exist
This commit is contained in:
@@ -2,6 +2,7 @@ package base
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -31,7 +32,9 @@ func logCleaner(_ context.Context, _ *modules.Task) error {
|
|||||||
filepath.Join(dataroot.Root().Path, logFileDir),
|
filepath.Join(dataroot.Root().Path, logFileDir),
|
||||||
func(path string, info os.FileInfo, err error) error {
|
func(path string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user