Codebase list golang-github-vbauerster-mpb / 12cda39
Abort: force refresh if only it's last uncompleted bar Vladimir Bauer 4 years ago
1 changed file(s) with 19 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
274274 }
275275 if drop {
276276 b.container.dropBar(b)
277 } else {
278 b.container.refreshCh <- time.Now()
279 }
280 b.cancel()
277 b.cancel()
278 return
279 }
280 go func() {
281 var uncompleted int
282 b.container.traverseBars(func(bar *Bar) bool {
283 if b != bar {
284 if !bar.Completed() {
285 uncompleted++
286 return false
287 }
288 }
289 return true
290 })
291 if uncompleted == 0 {
292 b.container.refreshCh <- time.Now()
293 }
294 b.cancel()
295 }()
281296 }:
282297 <-b.done
283298 case <-b.done: