func (p *Pipeline) ExtractRepositories(object string, after string, eventChan chan<- PipelineEvent, limit int) {
	if object != "" {
		log.Infof("Extracting all repositories for the org or group %v and accessible with the specified token.\n", object)
	} else {
		log.Info("Extracting all repositories accessible to the user providing the token.")
	}

	repositoryChannel := make(chan provider.GitRepository)

	extractionWorkersCount := p.ClonersCount
	if extractionWorkersCount == 0 {
		extractionWorkersCount = defaultExtractionWorkersCount
	}

	wg := sync.WaitGroup{}

	wg.Add(1)

	go p.gather(&wg, eventChan, object, repositoryChannel, limit)

	for i := 0; i < extractionWorkersCount; i++ {
		wg.Add(1)

		go func() {
			defer wg.Done()

			for repository := range repositoryChannel {
				if err := p.ExtractRepository(repository, after, eventChan); err != nil {
					log.Errorf("extracting %v failed: %v\n", repository.GetName(), err)
				}
			}
		}()
	}

	wg.Wait()
	log.Infof("Done extracting the org or group %v\n", object)
}
// ExtractRepositories extract repositories and analyze it for a given user and provider.
ExtractRepositories extract repositories and analyze it for a given user and provider.
// ExtractRepositories extract repositories and analyze it for a given user and provider .
func (p *Pipeline) ExtractRepositories(object string, after string, eventChan chan<- PipelineEvent, limit int) {
	if object != "" {
		log.Infof("Extracting all repositories for the org or group %v and accessible with the specified token.\n", object)
	} else {
		log.Info("Extracting all repositories accessible to the user providing the token.")
	}
	repositoryChannel := make(chan provider.GitRepository)
	extractionWorkersCount := p.ClonersCount
	if extractionWorkersCount == 0 {
		extractionWorkersCount = defaultExtractionWorkersCount
	}
	wg := sync.WaitGroup{}
	wg.Add(1)
	go p.gather(&wg, eventChan, object, repositoryChannel, limit)
	for i := 0; i < extractionWorkersCount; i++ {
		wg.Add(1)
		go func() {
			defer wg.Done()
			for repository := range repositoryChannel {
				if err := p.ExtractRepository(repository, after, eventChan); err != nil {
					log.Errorf("extracting %v failed: %v\n", repository.GetName(), err)
				}
			}
		}()
	}
	wg.Wait()
	log.Infof("Done extracting the org or group %v\n", object)
}
func ( p * Pipeline ) ExtractRepositories ( object string , after string , eventChan chan <- PipelineEvent , limit int ) { if object != " " { log . Infof ( " \n " , object ) } else { log . Info ( " " ) } repositoryChannel := make ( chan provider . GitRepository ) extractionWorkersCount := p . ClonersCount if extractionWorkersCount == 0 { extractionWorkersCount = defaultExtractionWorkersCount } wg := sync . WaitGroup { } wg . Add ( 1 ) go p . gather ( & wg , eventChan , object , repositoryChannel , limit ) for i := 0 ; i < extractionWorkersCount ; i ++ { wg . Add ( 1 ) go func ( ) { defer wg . Done ( ) for repository := range repositoryChannel { if err := p . ExtractRepository ( repository , after , eventChan ) ; err != nil { log . Errorf ( " \n " , repository . GetName ( ) , err ) } } } ( ) } wg . Wait ( ) log . Infof ( " \n " , object ) }
ExtractRepositories extract repositories and analyze it for a given user and provider.
ExtractRepositories extract repositories and analyze it for a given user and provider .