ForceAutoRefresh ContainerOpation
Vladimir Bauer
3 years ago
| 85 | 85 |
}
|
| 86 | 86 |
}
|
| 87 | 87 |
|
|
88 |
// ForceAutoRefresh force auto refresh even if output is not terminal.
|
|
89 |
// Useful for testing purposes.
|
|
90 |
func ForceAutoRefresh() ContainerOption {
|
|
91 |
return func(s *pState) {
|
|
92 |
s.forceAutoRefresh = true
|
|
93 |
}
|
|
94 |
}
|
|
95 |
|
| 88 | 96 |
// PopCompletedMode will pop completed bars to the top.
|
| 89 | 97 |
// To stop rendering bar after it has been popped, use
|
| 90 | 98 |
// mpb.BarRemoveOnComplete() option on that bar.
|
| 43 | 43 |
popPriority int
|
| 44 | 44 |
popCompleted bool
|
| 45 | 45 |
disableAutoRefresh bool
|
|
46 |
forceAutoRefresh bool
|
| 46 | 47 |
manualRefresh chan interface{}
|
| 47 | 48 |
renderDelay <-chan struct{}
|
| 48 | 49 |
shutdownNotifier chan<- interface{}
|
|
| 228 | 229 |
ch := make(chan time.Time)
|
| 229 | 230 |
go func() {
|
| 230 | 231 |
var autoRefresh <-chan time.Time
|
| 231 | |
if isTerminal && !s.disableAutoRefresh {
|
|
232 |
if (isTerminal || s.forceAutoRefresh) && !s.disableAutoRefresh {
|
| 232 | 233 |
if s.renderDelay != nil {
|
| 233 | 234 |
<-s.renderDelay
|
| 234 | 235 |
}
|