From a7f487b1ddd2e8b3818eae31b6dafd4bb8c54ac5 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 4 Nov 2016 21:53:06 +0100 Subject: [PATCH] Extract SyncThreadsMax to separate variable --- sync.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sync.go b/sync.go index 825de99..bf38c16 100644 --- a/sync.go +++ b/sync.go @@ -10,7 +10,9 @@ import ( // in case of two used disks per write (RAID 1, 5) and queue depth of 2, // 16 concurrent Sync calls should be able to saturate 16 HDDs RAID //TODO: benchmark it out, maybe provide tweak parmeter -var syncSemaphore chan struct{} = make(chan struct{}, 16) +const SyncThreadsMax = 16 + +var syncSemaphore chan struct{} = make(chan struct{}, SyncThreadsMax) func syncDir(dir string) error { if runtime.GOOS == "windows" {