refactoring forceRefreshImpl => tryEarlyRefresh
Vladimir Bauer
3 years ago
| 450 | 450 | |
| 451 | 451 | func (b *Bar) triggerCompletion(autoRefresh bool, refreshCh chan<- time.Time) { |
| 452 | 452 | if autoRefresh { |
| 453 | go b.forceRefreshImpl(refreshCh) | |
| 453 | go b.tryEarlyRefresh(refreshCh) | |
| 454 | 454 | } else { |
| 455 | 455 | b.cancel() |
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | func (b *Bar) forceRefreshImpl(refreshCh chan<- time.Time) { | |
| 459 | func (b *Bar) tryEarlyRefresh(refreshCh chan<- time.Time) { | |
| 460 | 460 | var anyOtherRunning bool |
| 461 | 461 | b.container.traverseBars(func(bar *Bar) bool { |
| 462 | 462 | anyOtherRunning = b != bar && bar.IsRunning() |