Skip to content

Commit

Permalink
#19 only enable parallel mode greater than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
codekoala committed Dec 8, 2017
1 parent a96c4c8 commit 265b4bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/sh.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ var shCmd = &cobra.Command{
}

numParallel := getNumParallel(fl, len(servers))
cmd.Printf("Executing on %d servers in parallel\n", numParallel)
if numParallel > 0 {
if numParallel > 1 {
cmd.Printf("Executing on %d servers in parallel\n", numParallel)
result = runInParallel(numParallel, servers, sh)
} else {
result = runInSequence(servers, sh)
Expand All @@ -81,7 +81,7 @@ func getNumParallel(flags *pflag.FlagSet, total int) int {
} else if inParallel {
numParallel = total
} else {
numParallel = -1
return -1
}

// do a little bounds checking
Expand Down Expand Up @@ -130,7 +130,7 @@ func runInParallel(numParallel int, servers []*lanes.Server, sh string) (result
mani.Add(sess)
}

fmt.Printf("Executing on %d servers: %s\n", len(servers), sh)
fmt.Printf("Executing on %d server(s): %s\n", len(servers), sh)
mani.Begin(ctx)

// launch at most numParallel commands at one time
Expand Down

0 comments on commit 265b4bf

Please sign in to comment.