Files
podman/vendor/github.com/vbauerster/mpb/progress_windows.go
Valentin Rothberg c069d11759 vendor containers/image v1.4
This requires some additional changes to the dependencies since the
progress-bar library has been changed to github.com/vbauerster/mpb.

Please refer to the following link for the release notes:
https://github.com/containers/image/releases/tag/v1.4

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-21 11:54:04 +01:00

44 lines
639 B
Go

// +build windows
package mpb
import (
"time"
)
func (p *Progress) serve(s *pState) {
var ticker *time.Ticker
var refreshCh <-chan time.Time
if s.manualRefreshCh == nil {
ticker = time.NewTicker(s.rr)
refreshCh = ticker.C
} else {
refreshCh = s.manualRefreshCh
}
for {
select {
case op := <-p.operateState:
op(s)
case <-refreshCh:
if s.zeroWait {
if s.manualRefreshCh == nil {
ticker.Stop()
}
if s.shutdownNotifier != nil {
close(s.shutdownNotifier)
}
close(p.done)
return
}
tw, err := s.cw.GetWidth()
if err != nil {
tw = s.width
}
s.render(tw)
}
}
}