From 2503a7663fa78c798fe39cfd70e4391a697812c1 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Thu, 31 Mar 2022 13:30:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96OpenFileCache=20fsnotify?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/open_file_cache.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/caches/open_file_cache.go b/internal/caches/open_file_cache.go index 5fa7de7..b5ea71d 100644 --- a/internal/caches/open_file_cache.go +++ b/internal/caches/open_file_cache.go @@ -9,6 +9,7 @@ import ( "github.com/iwind/TeaGo/logs" "github.com/iwind/TeaGo/types" "path/filepath" + "runtime" "sync" "time" ) @@ -43,7 +44,7 @@ func NewOpenFileCache(maxSize int) (*OpenFileCache, error) { goman.New(func() { for event := range watcher.Events { - if event.Op&fsnotify.Chmod != fsnotify.Chmod { + if runtime.GOOS == "linux" || event.Op&fsnotify.Chmod != fsnotify.Chmod { cache.Close(event.Name) } }