fixes quiet mode hang issue

This commit is contained in:
Anand Babu (AB) Periasamy
2015-07-13 16:08:15 -07:00
parent c7de6a99e3
commit 693c3ddd06
2 changed files with 14 additions and 14 deletions
+6 -7
View File
@@ -181,12 +181,6 @@ func doCopyCmdSession(session *sessionV2) {
doPrepareCopyURLs(session, trapCh)
}
var bar barSend
if !globalQuietFlag { // set up progress bar
bar = newCpBar()
defer bar.Finish()
}
wg := new(sync.WaitGroup)
cpQueue := make(chan bool, int(math.Max(float64(runtime.NumCPU())-1, 1)))
defer close(cpQueue)
@@ -195,7 +189,12 @@ func doCopyCmdSession(session *sessionV2) {
isCopied := isCopiedFactory(session.Header.LastCopied)
bar.Extend(session.Header.TotalBytes)
var bar barSend
if !globalQuietFlag { // set up progress bar
bar = newCpBar()
defer bar.Finish()
bar.Extend(session.Header.TotalBytes)
}
for scanner.Scan() {
var cpURLs copyURLs
+8 -7
View File
@@ -184,12 +184,6 @@ func doSyncCmdSession(session *sessionV2) {
doPrepareSyncURLs(session, trapCh)
}
var bar barSend
if !globalQuietFlag { // set up progress bar
bar = newCpBar()
defer bar.Finish()
}
wg := new(sync.WaitGroup)
syncQueue := make(chan bool, int(math.Max(float64(runtime.NumCPU())-1, 1)))
defer close(syncQueue)
@@ -198,7 +192,14 @@ func doSyncCmdSession(session *sessionV2) {
isCopied := isCopiedFactory(session.Header.LastCopied)
bar.Extend(session.Header.TotalBytes)
var bar barSend
if !globalQuietFlag { // set up progress bar
bar = newCpBar()
defer bar.Finish()
bar.Extend(session.Header.TotalBytes)
}
for scanner.Scan() {
var sURLs syncURLs
json.Unmarshal([]byte(scanner.Text()), &sURLs)