From 882e005e42ea3d36c5e5a28c27979b13e6d46982 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Tue, 9 Jun 2020 11:53:24 -0400 Subject: [PATCH] Make the sync command respect the concurrency config parameter, instead of always using 4. --- cmd_sync.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd_sync.go b/cmd_sync.go index 952b233..24129cf 100644 --- a/cmd_sync.go +++ b/cmd_sync.go @@ -26,7 +26,6 @@ type Action struct { } const ( - NUM_COPY = 4 NUM_CHECKSUM = 1 QUEUE_SIZE = 1000000 // 1M ) @@ -160,8 +159,8 @@ func CmdSync(config *Config, c *cli.Context) error { go workerChecksum(config, &wg, chanChecksum, chanProgress) } - wg.Add(NUM_COPY) - for i := 0; i < NUM_COPY; i++ { + wg.Add(config.Concurrency) + for i := 0; i < config.Concurrency; i++ { go workerCopy(config, &wg, chanCopy, chanProgress) }