Skip to content

Commit

Permalink
disable goroutines when multithreading is off
Browse files Browse the repository at this point in the history
  • Loading branch information
MRtecno98 committed Nov 19, 2024
1 parent f4ca46d commit b614559
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func main() {
var wait sync.WaitGroup
wait.Add(len(pls))
for _, pli := range pls {
func(pl bucket.Plugin) {
f := func(pl bucket.Plugin) {
defer wait.Done()
res, err := oc.ResolvePlugin(pl)
if err != nil {
Expand All @@ -226,7 +226,13 @@ func main() {

log.Printf("found plugin: %s [%s] %s %s%s %f\n", pl.GetName(), res.GetRepository().Provider(), res.GetName(),
ver.GetName(), res.GetAuthors(), ind)
}(pli)
}

if bucket.GlobalConfig.Multithread {
go f(pli)
} else {
f(pli)
}
}

wait.Wait()
Expand Down

0 comments on commit b614559

Please sign in to comment.