Skip to content

Commit 15d6d85

Browse files
committed
backend: plugins: Fix for skipping CHMOD events in plug watcher
This was causing a loop in the frontend if the plugin had a chmod file in it on Mac with electron.
1 parent 77399a4 commit 15d6d85

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

backend/pkg/plugins/plugins.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,13 @@ func canSendRefresh(c cache.Cache[interface{}]) bool {
377377
func HandlePluginEvents(staticPluginDir, userPluginDir, pluginDir string,
378378
notify <-chan string, cache cache.Cache[interface{}],
379379
) {
380-
for range notify {
380+
for event := range notify {
381+
// Skip CHMOD events to avoid looping on electron when user-plugins folder is watched
382+
// these events are not relevant to see if plugins have changed.
383+
if strings.HasSuffix(event, "CHMOD") {
384+
continue
385+
}
386+
381387
// Set the refresh signal only if we cannot send it. We prevent it here
382388
// because we only want to send refresh signals that *happen after* we are
383389
// allowed to send them.

0 commit comments

Comments
 (0)