Skip to content

Commit

Permalink
wait for user wg last
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Aug 16, 2024
1 parent fe6ed33 commit 894f0aa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,12 @@ func (p *Progress) Write(b []byte) (int, error) {
// Wait waits for all bars to complete and finally shutdowns container. After
// this method has been called, there is no way to reuse `*Progress` instance.
func (p *Progress) Wait() {
p.bwg.Wait()
p.Shutdown()
// wait for user wg, if any
if p.uwg != nil {
p.uwg.Wait()
}

p.bwg.Wait()
p.Shutdown()
}

// Shutdown cancels any running bar immediately and then shutdowns `*Progress`
Expand Down

0 comments on commit 894f0aa

Please sign in to comment.