fix: get bar length right

This commit is contained in:
decentral1se 2021-12-19 23:23:46 +01:00
parent 4c66e44b3a
commit b912e73c5e
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 9 additions and 2 deletions

View File

@ -103,9 +103,16 @@ A new catalogue copy can be published to the recipes repository by passing the
logrus.Debugf("ensuring '%v' recipe(s) are locally present and up-to-date", len(repos))
var barLength int
if recipeName != "" {
barLength = 1
} else {
barLength = len(repos)
}
cloneLimiter := limit.New(10)
retrieveBar := formatter.CreateProgressbar(len(repos), "retrieving recipes from recipes.coopcloud.tech...")
ch := make(chan string, len(repos))
ch := make(chan string, barLength)
for _, repoMeta := range repos {
go func(rm catalogue.RepoMeta) {
cloneLimiter.Begin()
@ -151,7 +158,7 @@ A new catalogue copy can be published to the recipes repository by passing the
}
catl := make(catalogue.RecipeCatalogue)
catlBar := formatter.CreateProgressbar(len(repos), "generating catalogue...")
catlBar := formatter.CreateProgressbar(barLength, "generating catalogue metadata...")
for _, recipeMeta := range repos {
if recipeName != "" && recipeName != recipeMeta.Name {
catlBar.Add(1)