1
0

fix: check that max is reached after unlock

This commit is contained in:
dump_stack() 2023-05-22 06:58:13 +00:00
parent d507b86373
commit 519b8d190a
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -535,18 +535,20 @@ func GenerateKernels(km config.Target, registry string,
swg := sizedwaitgroup.New(threads)
for i, pkg := range pkgs {
if *shutdown {
err = nil
return
}
log.Info().Msgf("%d/%d %s", i+1, len(pkgs), pkg)
swg.Add()
if max <= 0 {
log.Print("Max is reached")
break
}
if *shutdown {
err = nil
return
}
log.Info().Msgf("%d/%d %s", i+1, len(pkgs), pkg)
swg.Add()
go func() {
defer swg.Done()
var attempt int