From 1006a7040fe51c5dbe56df27ad10275f86e943f1 Mon Sep 17 00:00:00 2001 From: vinllen Date: Wed, 3 Apr 2019 13:47:53 +0800 Subject: [PATCH] modify code: enable heartbeat=0 --- src/redis-shake/main/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/redis-shake/main/main.go b/src/redis-shake/main/main.go index 94c4c8d..5b77f38 100644 --- a/src/redis-shake/main/main.go +++ b/src/redis-shake/main/main.go @@ -172,7 +172,7 @@ func sanitizeOptions(tp string) error { runtime.GOMAXPROCS(conf.Options.NCpu) } - if conf.Options.Parallel == 0 { + if conf.Options.Parallel == 0 { // not set conf.Options.Parallel = 1 } else if conf.Options.Parallel > 1024 { return fmt.Errorf("parallel[%v] should in (0, 1024]", conf.Options.Parallel) @@ -217,9 +217,9 @@ func sanitizeOptions(tp string) error { log.StdLog = log.New(utils.LogRotater, "") } - // heartbeat - if conf.Options.HeartbeatInterval <= 0 || conf.Options.HeartbeatInterval > 86400 { - return fmt.Errorf("HeartbeatInterval[%v] should in (0, 86400]", conf.Options.HeartbeatInterval) + // heartbeat, 86400 = 1 day + if conf.Options.HeartbeatInterval > 86400 { + return fmt.Errorf("HeartbeatInterval[%v] should in [0, 86400]", conf.Options.HeartbeatInterval) } if conf.Options.HeartbeatNetworkInterface == "" { conf.Options.HeartbeatIp = "127.0.0.1"