diff --git a/settings/arguments.go b/settings/arguments.go index f0de907..ca485ab 100644 --- a/settings/arguments.go +++ b/settings/arguments.go @@ -64,9 +64,6 @@ func Initialize() { } setSource(arguments[0]) setTarget(arguments[1]) - if Concurrency == 0 { - setConcurrency(runtime.NumCPU()) - } _, error := os.Stat(Source) if os.IsNotExist(error) { log.Fatal("given source does not exist", Source) diff --git a/tools/rsync.go b/tools/rsync.go index 3734815..daa2bc7 100644 --- a/tools/rsync.go +++ b/tools/rsync.go @@ -32,7 +32,11 @@ func Transfer() { timestamp := time.Now() counter := 0 totalbar := createProgressBar(barcontainer, "Total", int64(0), int64(sourcefilesCount), sourcefilesCount+1, true) - channel := make(chan struct{}, settings.Concurrency) + concurrency := settings.Concurrency + if concurrency == 0 { + concurrency = sourcefilesCount + } + channel := make(chan struct{}, concurrency) for index, file := range sourcefiles { channel <- struct{}{} if index > 0 {