MCPcopy Index your code
hub / github.com/cloudfoundry/cli / printProgress

Method printProgress

cf/net/progress_reader.go:64–81  ·  view source on GitHub ↗
(quit chan bool)

Source from the content-addressed store, hash-verified

62}
63
64func (progressReader *ProgressReader) printProgress(quit chan bool) {
65 timer := time.NewTicker(progressReader.outputInterval)
66
67 for {
68 select {
69 case <-quit:
70 // The spaces are there to ensure we overwrite the entire line
71 // before using the terminal printer to output Done Uploading
72 progressReader.ui.PrintCapturingNoOutput("\r ")
73 progressReader.ui.Say("\rDone uploading")
74 return
75 case <-timer.C:
76 progressReader.mutex.RLock()
77 progressReader.ui.PrintCapturingNoOutput("\r%s uploaded...", formatters.ByteSize(progressReader.bytesRead))
78 progressReader.mutex.RUnlock()
79 }
80 }
81}
82
83func (progressReader *ProgressReader) SetTotalSize(size int64) {
84 progressReader.total = size

Callers 1

ReadMethod · 0.95

Calls 3

ByteSizeFunction · 0.92
SayMethod · 0.65

Tested by

no test coverage detected