forked from forgejo/forgejo
Catch os... errors
This commit is contained in:
parent
5ab85372da
commit
4ff0db0246
14 changed files with 123 additions and 29 deletions
|
@ -219,7 +219,10 @@ func (w *FileLogWriter) deleteOldLog() {
|
|||
|
||||
if !info.IsDir() && info.ModTime().Unix() < (time.Now().Unix()-60*60*24*w.Maxdays) {
|
||||
if strings.HasPrefix(filepath.Base(path), filepath.Base(w.Filename)) {
|
||||
os.Remove(path)
|
||||
|
||||
if err := os.Remove(path); err != nil {
|
||||
returnErr = fmt.Errorf("Fail to remove %s: %v", path, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnErr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue