MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / processEvents

Method processEvents

internal/watcher/events.go:48–65  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

46}
47
48func (w *Watcher) processEvents(ctx context.Context) {
49 for {
50 select {
51 case <-ctx.Done():
52 return
53 case event, ok := <-w.watcher.Events:
54 if !ok {
55 return
56 }
57 w.handleEvent(event)
58 case errWatch, ok := <-w.watcher.Errors:
59 if !ok {
60 return
61 }
62 log.Errorf("file watcher error: %v", errWatch)
63 }
64 }
65}
66
67func (w *Watcher) handleEvent(event fsnotify.Event) {
68 // Filter only relevant events: config file or auth-dir JSON files.

Calls 1

handleEventMethod · 0.95