Codebase list golang-github-vbauerster-mpb / 5b31537
fix force refresh on late refresh rate Vladimir Bauer 7 years ago
1 changed file(s) with 7 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
246246 select {
247247 case b.operateState <- func(s *bState) {
248248 s.current += int64(n)
249 if s.current >= s.total {
249 if s.current >= s.total && !s.toComplete {
250250 s.current = s.total
251251 s.toComplete = true
252252 go b.forceRefresh()
411411 }
412412
413413 func (b *Bar) forceRefresh() {
414 select {
415 case b.forceRefreshCh <- time.Now():
416 case <-b.shutdown:
414 for {
415 select {
416 case b.forceRefreshCh <- time.Now():
417 case <-b.shutdown:
418 return
419 }
417420 }
418421 }
419422