MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / Start

Method Start

watcher/file.go:41–62  ·  view source on GitHub ↗

Start is a runloop to watch for files changes from the file paths added from Add()

(notifier Notification)

Source from the content-addressed store, hash-verified

39
40// Start is a runloop to watch for files changes from the file paths added from Add()
41func (f *File) Start(notifier Notification) {
42 for {
43 select {
44 case event, ok := <-f.watcher.Events:
45 if !ok {
46 return
47 }
48 if event.Op&fsnotify.Write == fsnotify.Write {
49 notifier.WatcherItemDidChange(event.Name)
50 }
51 case err, ok := <-f.watcher.Errors:
52 if !ok {
53 return
54 }
55 notifier.WatcherDidError(err)
56
57 case <-f.shutdown:
58 f.watcher.Close()
59 return
60 }
61 }
62}

Callers 1

TestFileChangedFunction · 0.95

Calls 3

WatcherItemDidChangeMethod · 0.65
WatcherDidErrorMethod · 0.65
CloseMethod · 0.65

Tested by 1

TestFileChangedFunction · 0.76