MCPcopy
hub / github.com/docker/compose / loop

Method loop

pkg/watch/watcher_darwin.go:45–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45func (d *fseventNotify) loop() {
46 for {
47 select {
48 case <-d.stop:
49 return
50 case events, ok := <-d.stream.Events:
51 if !ok {
52 return
53 }
54
55 for _, e := range events {
56 e.Path = filepath.Join(string(os.PathSeparator), e.Path)
57
58 _, isPathWereWatching := d.pathsWereWatching[e.Path]
59 if e.Flags&fsevents.ItemIsDir == fsevents.ItemIsDir && e.Flags&fsevents.ItemCreated == fsevents.ItemCreated && isPathWereWatching {
60 // This is the first create for the path that we're watching. We always get exactly one of these
61 // even after we get the HistoryDone event. Skip it.
62 continue
63 }
64
65 d.events <- NewFileEvent(e.Path)
66 }
67 }
68 }
69}
70
71// Add a path to be watched. Should only be called during initialization.
72func (d *fseventNotify) initAdd(name string) {

Callers 1

StartMethod · 0.95

Calls 1

NewFileEventFunction · 0.85

Tested by

no test coverage detected