mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:30:56 +00:00
remove file bug fixed
remove file by filename and file suffix
This commit is contained in:
parent
2a148473e9
commit
3379a2b7ed
@ -256,7 +256,8 @@ 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)) {
|
||||
if strings.HasPrefix(filepath.Base(path), w.fileNameOnly) &&
|
||||
strings.HasSuffix(filepath.Base(path), w.suffix) {
|
||||
os.Remove(path)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user