From c7e4c5e446db9d508316a8563e9048d837df64a3 Mon Sep 17 00:00:00 2001 From: vinllen Date: Wed, 3 Apr 2019 11:53:53 +0800 Subject: [PATCH] set parallel to 1 when not set --- src/redis-shake/main/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/redis-shake/main/main.go b/src/redis-shake/main/main.go index 26dce4b..94c4c8d 100644 --- a/src/redis-shake/main/main.go +++ b/src/redis-shake/main/main.go @@ -172,7 +172,9 @@ func sanitizeOptions(tp string) error { runtime.GOMAXPROCS(conf.Options.NCpu) } - if conf.Options.Parallel == 0 || conf.Options.Parallel > 1024 { + if conf.Options.Parallel == 0 { + conf.Options.Parallel = 1 + } else if conf.Options.Parallel > 1024 { return fmt.Errorf("parallel[%v] should in (0, 1024]", conf.Options.Parallel) } else { conf.Options.Parallel = int(math.Max(float64(conf.Options.Parallel), float64(conf.Options.NCpu)))