log end-of-observe even when hidden (#2339)

## Does this PR need a docs update or release note?

- [x]  No 

## Type of change

- [x] 🧹 Tech Debt/Cleanup

## Issue(s)

* #2329

## Test Plan

- [x] 💪 Manual
This commit is contained in:
Keepers 2023-01-31 19:41:06 -07:00 committed by GitHub
parent ec7d3c6fc5
commit 7ee1575dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,7 +177,7 @@ func MessageWithCompletion(
completionCh := make(chan struct{}, 1) completionCh := make(chan struct{}, 1)
if cfg.hidden() { if cfg.hidden() {
return completionCh, func() {} return completionCh, func() { log.Info("done - " + clean) }
} }
wg.Add(1) wg.Add(1)
@ -232,7 +232,7 @@ func ItemProgress(
log.Debug(header) log.Debug(header)
if cfg.hidden() || rc == nil || totalBytes == 0 { if cfg.hidden() || rc == nil || totalBytes == 0 {
return rc, func() {} return rc, func() { log.Debug("done - " + header) }
} }
wg.Add(1) wg.Add(1)
@ -286,7 +286,7 @@ func ProgressWithCount(
} }
}(progressCh) }(progressCh)
return progressCh, func() {} return progressCh, func() { log.Info("done - " + lmsg) }
} }
wg.Add(1) wg.Add(1)
@ -381,16 +381,19 @@ func CollectionProgress(
if cfg.hidden() || len(user.String()) == 0 || len(dirName.String()) == 0 { if cfg.hidden() || len(user.String()) == 0 || len(dirName.String()) == 0 {
ch := make(chan struct{}) ch := make(chan struct{})
counted := 0
go func(ci <-chan struct{}) { go func(ci <-chan struct{}) {
for { for {
_, ok := <-ci _, ok := <-ci
if !ok { if !ok {
return return
} }
counted++
} }
}(ch) }(ch)
return ch, func() {} return ch, func() { log.Infow("done - "+message, "count", counted) }
} }
wg.Add(1) wg.Add(1)