diff --git a/cmd/execute.go b/cmd/execute.go index c14abd7..2e85b84 100644 --- a/cmd/execute.go +++ b/cmd/execute.go @@ -38,40 +38,6 @@ type runner struct{ GroupScale int } -func execSetsForEachGroup(tgts [] container.Container, runners []runner) { - var ser sync.Mutex // serialize non-async containers - runLevel := make(map[int][]container.Container) - - for i := range tgts { - rl := tgts[i].StartGroup - runLevel[rl] = append(runLevel[rl], tgts[i]) - } - - rls := maps.Keys(runLevel) - slices.Sort(rls) - - for _, r := range rls { - cs := runLevel[r] - ser.Lock() - fmt.Fprintln(output, "*** Running a command set for group", r, mapNames(cs)) - go func(async bool, conts []container.Container, ser *sync.Mutex) { - var wg sync.WaitGroup - defer func() { - wg.Wait() - ser.Unlock() - }() - for i := range conts { - wg.Add(1) - go runSet(&conts[i], getSet, &wg) - } - if !async { - time.Sleep(2 * time.Second) - } - }(r == 0, cs, &ser) - } - ser.Lock() -} - func execForEach(tgts []container.Container, getSet func(*container.Container) command.CommandSet, groupScale int) { var ser sync.Mutex // serialize non-async containers runLevel := make(map[int][]container.Container)