MCPcopy
hub / github.com/perkeep/perkeep / syncLoop

Method syncLoop

pkg/server/sync.go:602–618  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

600}
601
602func (sh *SyncHandler) syncLoop() {
603 for {
604 t0 := time.Now()
605
606 for sh.runSync(sh.fromName, sh.enumeratePendingBlobs) > 0 {
607 // Loop, before sleeping.
608 }
609 sh.setStatusf("Sleeping briefly before next long poll.")
610
611 d := queueSyncInterval - time.Since(t0)
612 select {
613 case <-time.After(d):
614 sh.signalIdle()
615 case <-sh.wakec:
616 }
617 }
618}
619
620func (sh *SyncHandler) copyWorker(res chan<- copyResult, work <-chan blob.SizedRef) {
621 for sb := range work {

Callers 2

newSyncFromConfigFunction · 0.80
NewSyncHandlerFunction · 0.80

Calls 3

runSyncMethod · 0.95
setStatusfMethod · 0.95
signalIdleMethod · 0.95

Tested by

no test coverage detected