Skip to content

Commit aa5cdf2

Browse files
committed
add support for COMPOSE_PARALLEL_LIMIT (parity with Compose v1)
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent b96e27e commit aa5cdf2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/compose/compose.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"os"
2323
"os/signal"
2424
"path/filepath"
25+
"strconv"
2526
"strings"
2627
"syscall"
2728

@@ -324,6 +325,13 @@ func RootCommand(streams api.Streams, backend api.Service) *cobra.Command { //no
324325
return err
325326
}
326327
}
328+
if v, ok := os.LookupEnv("COMPOSE_PARALLEL_LIMIT"); ok && !cmd.Flags().Changed("parallel") {
329+
i, err := strconv.Atoi(v)
330+
if err != nil {
331+
return fmt.Errorf("COMPOSE_PARALLEL_LIMIT must be an integer (found: %q)", v)
332+
}
333+
parallel = i
334+
}
327335
if parallel > 0 {
328336
backend.MaxConcurrency(parallel)
329337
}

0 commit comments

Comments
 (0)