MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / Start

Method Start

pkg/wconfig/filewatcher.go:64–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64func (w *Watcher) Start() {
65 w.mutex.Lock()
66 defer w.mutex.Unlock()
67
68 log.Printf("starting file watcher\n")
69 w.initialized = true
70 w.sendInitialValues()
71
72 go func() {
73 defer func() {
74 panichandler.PanicHandler("filewatcher:Start", recover())
75 }()
76 for {
77 select {
78 case event, ok := <-w.watcher.Events:
79 if !ok {
80 return
81 }
82 w.handleEvent(event)
83 case err, ok := <-w.watcher.Errors:
84 if !ok {
85 return
86 }
87 log.Println("watcher error:", err)
88 }
89 }
90 }()
91}
92
93// for initial values, exit on first error
94func (w *Watcher) sendInitialValues() error {

Callers

nothing calls this directly

Calls 3

sendInitialValuesMethod · 0.95
handleEventMethod · 0.95
PanicHandlerFunction · 0.92

Tested by

no test coverage detected