8807c327 by astaxie

fix log delete

1 parent d627ec01
Showing 1 changed file with 2 additions and 0 deletions
...@@ -202,8 +202,10 @@ func (w *FileLogWriter) deleteOldLog() { ...@@ -202,8 +202,10 @@ func (w *FileLogWriter) deleteOldLog() {
202 dir := path.Dir(w.filename) 202 dir := path.Dir(w.filename)
203 filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { 203 filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
204 if !info.IsDir() && info.ModTime().Unix() < (time.Now().Unix()-60*60*24*w.maxdays) { 204 if !info.IsDir() && info.ModTime().Unix() < (time.Now().Unix()-60*60*24*w.maxdays) {
205 if strings.HasPrefix(filepath.Base(path), filepath.Base(w.filename)) {
205 os.Remove(path) 206 os.Remove(path)
206 } 207 }
208 }
207 return nil 209 return nil
208 }) 210 })
209 } 211 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!