MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / processEvents

Method processEvents

internal/prd/progress.go:153–180  ·  view source on GitHub ↗

processEvents listens for filesystem events and re-parses progress.md on change.

()

Source from the content-addressed store, hash-verified

151
152// processEvents listens for filesystem events and re-parses progress.md on change.
153func (w *ProgressWatcher) processEvents() {
154 progressPath := filepath.Join(w.dir, "progress.md")
155 for {
156 select {
157 case <-w.done:
158 close(w.events)
159 return
160
161 case event, ok := <-w.watcher.Events:
162 if !ok {
163 return
164 }
165 if event.Op&(fsnotify.Write|fsnotify.Create) != 0 {
166 if filepath.Base(event.Name) == "progress.md" {
167 entries, err := ParseProgress(progressPath)
168 if err == nil && entries != nil {
169 w.events <- entries
170 }
171 }
172 }
173
174 case _, ok := <-w.watcher.Errors:
175 if !ok {
176 return
177 }
178 }
179 }
180}

Callers 1

StartMethod · 0.95

Calls 1

ParseProgressFunction · 0.85

Tested by

no test coverage detected