mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Fix error log when no logs exist
This commit is contained in:
parent
f51a1c0492
commit
2d9e07aa79
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue