fix: check that max is reached after unlock
This commit is contained in:
parent
d507b86373
commit
519b8d190a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user