Codebase list golang-github-vbauerster-mpb / 249b82a
ForceAutoRefresh ContainerOpation Vladimir Bauer 3 years ago
2 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
8585 }
8686 }
8787
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
8896 // PopCompletedMode will pop completed bars to the top.
8997 // To stop rendering bar after it has been popped, use
9098 // mpb.BarRemoveOnComplete() option on that bar.
4343 popPriority int
4444 popCompleted bool
4545 disableAutoRefresh bool
46 forceAutoRefresh bool
4647 manualRefresh chan interface{}
4748 renderDelay <-chan struct{}
4849 shutdownNotifier chan<- interface{}
228229 ch := make(chan time.Time)
229230 go func() {
230231 var autoRefresh <-chan time.Time
231 if isTerminal && !s.disableAutoRefresh {
232 if (isTerminal || s.forceAutoRefresh) && !s.disableAutoRefresh {
232233 if s.renderDelay != nil {
233234 <-s.renderDelay
234235 }