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

Method Changes

helper/server/downstream.go:306–326  ·  view source on GitHub ↗

Changes retrieves all changes from the watch path

(empty *remote.Empty, stream remote.Downstream_ChangesServer)

Source from the content-addressed store, hash-verified

304
305// Changes retrieves all changes from the watch path
306func (d *Downstream) Changes(empty *remote.Empty, stream remote.Downstream_ChangesServer) error {
307 newState := make(map[string]*remote.Change)
308 throttle := time.Duration(d.options.Throttle) * time.Millisecond
309
310 // Walk through the dir
311 if !d.options.Polling {
312 newState = d.getWatchState()
313 } else {
314 walkDir(d.options.RemotePath, d.options.RemotePath, d.ignoreMatcher, newState, d.options.NoRecursiveWatch, throttle)
315 }
316
317 if newState != nil {
318 _, err := streamChanges(d.options.RemotePath, d.watchedFiles, newState, stream, throttle)
319 if err != nil {
320 return errors.Wrap(err, "stream changes")
321 }
322
323 d.watchedFiles = newState
324 }
325 return nil
326}
327
328func (d *Downstream) watch(stopChan chan struct{}) {
329 for {

Callers

nothing calls this directly

Calls 3

getWatchStateMethod · 0.95
walkDirFunction · 0.85
streamChangesFunction · 0.85

Tested by

no test coverage detected