diff --git a/internal/command/scale/count_machines.go b/internal/command/scale/count_machines.go index 8fab9cd8a2..51aa6d1e6b 100644 --- a/internal/command/scale/count_machines.go +++ b/internal/command/scale/count_machines.go @@ -20,6 +20,8 @@ import ( "github.com/superfly/flyctl/iostreams" ) +const maxConcurrentActions = 5 + func runMachinesScaleCount(ctx context.Context, appName string, appConfig *appconfig.Config, expectedGroupCounts groupCounts, maxPerRegion int) error { io := iostreams.FromContext(ctx) flapsClient := flapsutil.ClientFromContext(ctx) @@ -131,16 +133,6 @@ func runMachinesScaleCount(ctx context.Context, appName string, appConfig *appco return err } - // Deleting machines is safe to parallelize, - // but creating machines is not because of how the platform propagetes data. - maxConcurrentActions := 5 - _, scaleUp := lo.Find(actions, func(a *planItem) bool { - return a.Delta > 0 - }) - if scaleUp { - maxConcurrentActions = 1 - } - updatePool := pool.New(). WithErrors(). WithMaxGoroutines(maxConcurrentActions).