modify code: enable heartbeat=0

v4
vinllen 6 years ago
parent cfbde08f9d
commit be0225d44a
  1. 8
      src/redis-shake/main/main.go

@ -172,7 +172,7 @@ func sanitizeOptions(tp string) error {
runtime.GOMAXPROCS(conf.Options.NCpu) runtime.GOMAXPROCS(conf.Options.NCpu)
} }
if conf.Options.Parallel == 0 { if conf.Options.Parallel == 0 { // not set
conf.Options.Parallel = 1 conf.Options.Parallel = 1
} else if conf.Options.Parallel > 1024 { } else if conf.Options.Parallel > 1024 {
return fmt.Errorf("parallel[%v] should in (0, 1024]", conf.Options.Parallel) 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, "") log.StdLog = log.New(utils.LogRotater, "")
} }
// heartbeat // heartbeat, 86400 = 1 day
if conf.Options.HeartbeatInterval <= 0 || conf.Options.HeartbeatInterval > 86400 { if conf.Options.HeartbeatInterval > 86400 {
return fmt.Errorf("HeartbeatInterval[%v] should in (0, 86400]", conf.Options.HeartbeatInterval) return fmt.Errorf("HeartbeatInterval[%v] should in [0, 86400]", conf.Options.HeartbeatInterval)
} }
if conf.Options.HeartbeatNetworkInterface == "" { if conf.Options.HeartbeatNetworkInterface == "" {
conf.Options.HeartbeatIp = "127.0.0.1" conf.Options.HeartbeatIp = "127.0.0.1"

Loading…
Cancel
Save