From f7d91fb3572d3f7eafd53a2826e96dfb67a99143 Mon Sep 17 00:00:00 2001 From: vinllen Date: Thu, 1 Aug 2019 11:06:56 +0800 Subject: [PATCH] release v1.6.14 3 --- src/redis-shake/main/main.go | 8 ++------ src/redis-shake/restore.go | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/redis-shake/main/main.go b/src/redis-shake/main/main.go index d1565e4..89fcb72 100644 --- a/src/redis-shake/main/main.go +++ b/src/redis-shake/main/main.go @@ -236,15 +236,11 @@ func sanitizeOptions(tp string) error { } if tp == conf.TypeDump || tp == conf.TypeSync { - if conf.Options.SourceRdbParallel <= 0 { - conf.Options.SourceRdbParallel = len(conf.Options.SourceAddressList) - } else if conf.Options.SourceRdbParallel > len(conf.Options.SourceAddressList) { + if conf.Options.SourceRdbParallel <= 0 || conf.Options.SourceRdbParallel > len(conf.Options.SourceAddressList) { conf.Options.SourceRdbParallel = len(conf.Options.SourceAddressList) } } else if tp == conf.TypeRestore || tp == conf.TypeDecode { - if conf.Options.SourceRdbParallel <= 0 { - conf.Options.SourceRdbParallel = len(conf.Options.SourceRdbInput) - } else if conf.Options.SourceRdbParallel > len(conf.Options.SourceRdbInput) { + if conf.Options.SourceRdbParallel <= 0 || conf.Options.SourceRdbParallel > len(conf.Options.SourceRdbInput) { conf.Options.SourceRdbParallel = len(conf.Options.SourceRdbInput) } } diff --git a/src/redis-shake/restore.go b/src/redis-shake/restore.go index 708e2af..4c000f8 100644 --- a/src/redis-shake/restore.go +++ b/src/redis-shake/restore.go @@ -45,7 +45,7 @@ func (cmd *CmdRestore) Main() { base.Status = "waitRestore" total := utils.GetTotalLink() restoreChan := make(chan restoreNode, total) - + for i, rdb := range conf.Options.SourceRdbInput { restoreChan <- restoreNode{id: i, input: rdb} }