()
| 600 | } |
| 601 | |
| 602 | func (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 | |
| 620 | func (sh *SyncHandler) copyWorker(res chan<- copyResult, work <-chan blob.SizedRef) { |
| 621 | for sb := range work { |
no test coverage detected