From 8c459d499af2745353068005969bf432b0b8477f Mon Sep 17 00:00:00 2001 From: John Date: Thu, 25 Oct 2018 22:18:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89gspath=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/os/gspath/gspath.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/g/os/gspath/gspath.go b/g/os/gspath/gspath.go index 4c762f71b..c0d25edee 100644 --- a/g/os/gspath/gspath.go +++ b/g/os/gspath/gspath.go @@ -9,13 +9,12 @@ package gspath import ( - "sync" "errors" - "strings" - "gitee.com/johng/gf/g/os/gfile" "gitee.com/johng/gf/g/container/gmap" + "gitee.com/johng/gf/g/os/gfile" "gitee.com/johng/gf/g/os/gfsnotify" - "gitee.com/johng/gf/g/os/glog" + "strings" + "sync" ) // 文件目录搜索管理对象 @@ -47,10 +46,10 @@ func (sp *SPath) Set(path string) error { sp.paths = []string{r} sp.mu.Unlock() sp.cache.Clear() - glog.Debug("gspath.SetPath:", r) + //glog.Debug("gspath.SetPath:", r) return nil } - glog.Warning("gspath.SetPath failed:", path) + //glog.Warning("gspath.SetPath failed:", path) return errors.New("invalid path:" + path) } @@ -68,10 +67,10 @@ func (sp *SPath) Add(path string) error { sp.mu.Lock() sp.paths = append(sp.paths, r) sp.mu.Unlock() - glog.Debug("gspath.Add:", r) + //glog.Debug("gspath.Add:", r) return nil } - glog.Warning("gspath.Add failed:", path) + //glog.Warning("gspath.Add failed:", path) return errors.New("invalid path:" + path) } @@ -106,9 +105,9 @@ func (sp *SPath) Size() int { // 添加文件监控,当文件删除时,同时也删除搜索结果缓存 func (sp *SPath) addMonitor(name, path string) { - glog.Debug("gspath.addMonitor:", name, path) + //glog.Debug("gspath.addMonitor:", name, path) gfsnotify.Add(path, func(event *gfsnotify.Event) { - glog.Debug("gspath.monitor:", event) + //glog.Debug("gspath.monitor:", event) if event.IsRemove() { sp.cache.Remove(name) }