8807c327 by astaxie

fix log delete

1 parent d627ec01
Showing 1 changed file with 3 additions and 1 deletions
...@@ -202,7 +202,9 @@ func (w *FileLogWriter) deleteOldLog() { ...@@ -202,7 +202,9 @@ 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 os.Remove(path) 205 if strings.HasPrefix(filepath.Base(path), filepath.Base(w.filename)) {
206 os.Remove(path)
207 }
206 } 208 }
207 return nil 209 return nil
208 }) 210 })
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!