From 281d4a642d87a23ed62045db899ff967abf8b818 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 18 Mar 2023 21:13:27 +0100 Subject: execenv: fix some cache building progress bar artifact Still one issue remaining: the last bar doesn't dissapear. Looks like a mbp issue. --- commands/execenv/loading.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'commands/execenv') diff --git a/commands/execenv/loading.go b/commands/execenv/loading.go index 2263f700..7838ea6a 100644 --- a/commands/execenv/loading.go +++ b/commands/execenv/loading.go @@ -156,13 +156,17 @@ func CacheBuildProgressBar(env *Env, events chan cache.BuildEvent) error { mpb.AppendDecorators(decor.Percentage(decor.WCSyncSpace)), ) case cache.BuildEventProgress: - bars[event.Typename].SetTotal(event.Total, false) bars[event.Typename].SetCurrent(event.Progress) + bars[event.Typename].SetTotal(event.Total, event.Progress == event.Total) + case cache.BuildEventFinished: + if bar := bars[event.Typename]; !bar.Completed() { + bar.SetTotal(0, true) + } } } if progress != nil { - progress.Shutdown() + progress.Wait() } return nil -- cgit