From 3f9f4f55c23a1669037fdf60f9951fe560be3d50 Mon Sep 17 00:00:00 2001 From: Evangelos Skopelitis Date: Mon, 29 Apr 2024 16:54:55 -0400 Subject: [PATCH] backend: plugins: Remove .plugins from watch list This fix prevents the development app (when running npm run dev-only-app) from watching for static plugins locally, which causes an endless loop of refreshes to the app. Fixes: #1937 Signed-off-by: Evangelos Skopelitis backend: plugins: Remove .plugins from watch list Signed-off-by: Evangelos Skopelitis fixed error Signed-off-by: Evangelos Skopelitis --- backend/pkg/plugins/plugins.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/pkg/plugins/plugins.go b/backend/pkg/plugins/plugins.go index 431052af218..036e51d8e2b 100644 --- a/backend/pkg/plugins/plugins.go +++ b/backend/pkg/plugins/plugins.go @@ -52,6 +52,10 @@ func periodicallyWatchSubfolders(watcher *fsnotify.Watcher, path string, interva for ; true; <-ticker.C { // Walk the path and add any new directories to the watcher. _ = filepath.WalkDir(path, func(path string, d fs.DirEntry, err error) error { + if strings.Contains(path, ".plugins") { + return filepath.SkipDir + } + if d != nil && d.IsDir() && !utils.Contains(watcher.WatchList(), path) { err := watcher.Add(path) if err != nil {