progress.go refactoring
Vladimir Bauer
9 years ago
| 215 | 215 | if isClosed(p.done) { |
| 216 | 216 | return |
| 217 | 217 | } |
| 218 | // fmt.Println("inside p.Stop") | |
| 219 | 218 | p.wg.Wait() |
| 220 | 219 | |
| 221 | 220 | p.beforeStopCh <- struct{}{} |
| 222 | // fmt.Println("signal sent to p.beforeStopCh") | |
| 223 | 221 | // wait for p.server to quit |
| 224 | 222 | <-p.done |
| 225 | 223 | } |
| 332 | 330 | b.flushed() |
| 333 | 331 | } |
| 334 | 332 | case <-p.beforeStopCh: |
| 335 | // fmt.Println("case beforeStopCh") | |
| 336 | 333 | for _, b := range bars { |
| 337 | 334 | if b.GetStatistics().Total <= 0 { |
| 338 | 335 | fmt.Println("completing the bar: ", b) |