MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / loop

Method loop

apps/server/internal/watcher/watcher.go:149–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147}
148
149func (w *Watcher) loop() {
150 // A disabled (no-op) watcher has no fsnotify handle — just block until close.
151 if w.fs == nil {
152 <-w.stopCh
153 return
154 }
155 for {
156 select {
157 case <-w.stopCh:
158 return
159 case err, ok := <-w.fs.Errors:
160 if !ok {
161 return
162 }
163 log.Printf("watcher error: %v", err)
164 case ev, ok := <-w.fs.Events:
165 if !ok {
166 return
167 }
168 w.handle(ev)
169 }
170 }
171}
172
173func (w *Watcher) relativePath(absPath string) string {
174 rel, err := filepath.Rel(w.root, absPath)

Callers 2

StartFunction · 0.95
DisabledFunction · 0.95

Calls 1

handleMethod · 0.95

Tested by

no test coverage detected