MCPcopy Create free account
hub / github.com/convox/rack / watchOutgoing

Method watchOutgoing

pkg/sync/sync.go:439–458  ·  view source on GitHub ↗
(st Stream)

Source from the content-addressed store, hash-verified

437}
438
439func (s *Sync) watchOutgoing(st Stream) {
440 ch := make(chan changes.Change, 1)
441
442 go func() {
443 if err := changes.Watch(s.Local, ch, changes.WatchOptions{Ignores: s.ignores}); err != nil {
444 st <- fmt.Sprintf("error: %s", err)
445 }
446 }()
447
448 for c := range ch {
449 s.lock.Lock()
450 if s.outgoingBlocks[c.Path] > 0 {
451 s.outgoingBlocks[c.Path]--
452 s.lock.Unlock()
453 } else {
454 s.lock.Unlock()
455 s.outgoing <- c
456 }
457 }
458}
459
460func inspectExec(id string, s *Sync, state chan execState, done chan struct{}) {
461

Callers 1

StartMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected