1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 11:30:39 +00:00

#390 should use filepath.Dir instead of path.Dir for.

This commit is contained in:
slene
2013-12-19 19:04:57 +08:00
parent 67b9c63528
commit 764bbd9897
2 changed files with 7 additions and 8 deletions

View File

@ -7,7 +7,6 @@ import (
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"strings"
"sync"
@ -201,7 +200,7 @@ func (w *FileLogWriter) DoRotate() error {
}
func (w *FileLogWriter) deleteOldLog() {
dir := path.Dir(w.Filename)
dir := filepath.Dir(w.Filename)
filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if !info.IsDir() && info.ModTime().Unix() < (time.Now().Unix()-60*60*24*w.Maxdays) {
if strings.HasPrefix(filepath.Base(path), filepath.Base(w.Filename)) {