Skip to content

Commit

Permalink
backend: plugins: Remove .plugins from watch list
Browse files Browse the repository at this point in the history
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 <eskopelitis@microsoft.com>

backend: plugins: Remove .plugins from watch list

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>

fixed error

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
  • Loading branch information
skoeva committed Apr 29, 2024
1 parent ce248d6 commit 3f9f4f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/pkg/plugins/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3f9f4f5

Please sign in to comment.