MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Start

Method Start

pkg/devspace/watch/watch.go:68–93  ·  view source on GitHub ↗

Start starts the watching process every second

()

Source from the content-addressed store, hash-verified

66
67// Start starts the watching process every second
68func (w *watcher) Start() {
69 w.startOnce.Do(func() {
70 go func() {
71 for {
72 select {
73 case <-w.interrupt:
74 return
75 case <-time.After(w.PollInterval):
76 changed, deleted, err := w.Update()
77 if err != nil {
78 w.Log.Errorf("Error during watcher update: %v", err)
79 return
80 }
81
82 if len(changed) > 0 || len(deleted) > 0 {
83 err = w.Callback(changed, deleted)
84 if err != nil {
85 w.Log.Errorf("Error during watcher callback: %v", err)
86 return
87 }
88 }
89 }
90 }
91 }()
92 })
93}
94
95// Stop stopps the watcher
96func (w *watcher) Stop() {

Callers

nothing calls this directly

Calls 2

UpdateMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected