MCPcopy
hub / github.com/perkeep/perkeep / startFullValidation

Method startFullValidation

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

Source from the content-addressed store, hash-verified

720}
721
722func (sh *SyncHandler) startFullValidation() {
723 sh.mu.Lock()
724 if sh.vshardDone == len(sh.vshards) {
725 sh.vshards, sh.vshardErrs = nil, nil
726 sh.vshardDone, sh.vmissing = 0, 0
727 sh.vdestCount, sh.vdestBytes = 0, 0
728 sh.vsrcCount, sh.vsrcBytes = 0, 0
729 }
730 if len(sh.vshards) != 0 {
731 sh.mu.Unlock()
732 return
733 }
734 sh.mu.Unlock()
735
736 sh.logf("running full validation; determining validation shards...")
737 shards := sh.shardPrefixes()
738
739 sh.mu.Lock()
740 if len(sh.vshards) != 0 {
741 sh.mu.Unlock()
742 return
743 }
744 sh.vshards = shards
745 sh.mu.Unlock()
746
747 go sh.runFullValidation()
748}
749
750func (sh *SyncHandler) runFullValidation() {
751 var wg sync.WaitGroup

Callers 2

ServeHTTPMethod · 0.95
newSyncFromConfigFunction · 0.80

Calls 5

logfMethod · 0.95
shardPrefixesMethod · 0.95
runFullValidationMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected