MCPcopy
hub / github.com/perkeep/perkeep / runFullValidation

Method runFullValidation

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

Source from the content-addressed store, hash-verified

748}
749
750func (sh *SyncHandler) runFullValidation() {
751 var wg sync.WaitGroup
752
753 sh.mu.Lock()
754 shards := sh.vshards
755 wg.Add(len(shards))
756 sh.mu.Unlock()
757
758 sh.logf("full validation beginning with %d shards...", len(shards))
759
760 const maxShardWorkers = 30 // arbitrary
761 gate := syncutil.NewGate(maxShardWorkers)
762
763 for _, pfx := range shards {
764 pfx := pfx
765 gate.Start()
766 go func() {
767 defer wg.Done()
768 defer gate.Done()
769 sh.validateShardPrefix(pfx)
770 }()
771 }
772 wg.Wait()
773 sh.logf("validation complete")
774}
775
776func (sh *SyncHandler) validateShardPrefix(pfx string) (err error) {
777 defer func() {

Callers 1

startFullValidationMethod · 0.95

Calls 7

logfMethod · 0.95
validateShardPrefixMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
WaitMethod · 0.80
StartMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected