mirror of https://github.com/docker/buildx.git
progress: make printer ready only after pausing logrus
This fixes a possible race where messages printed directly after calls to NewPrinter may appear before the printer starts. With this change, we delay all of the logs until after. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
parent
9b07f6510a
commit
be6542911f
|
@ -120,9 +120,8 @@ func NewPrinter(ctx context.Context, w io.Writer, out console.File, mode string,
|
|||
pw.logSourceMap = map[digest.Digest]interface{}{}
|
||||
pw.logMu.Unlock()
|
||||
|
||||
close(pw.ready)
|
||||
|
||||
resumeLogs := logutil.Pause(logrus.StandardLogger())
|
||||
close(pw.ready)
|
||||
// not using shared context to not disrupt display but let is finish reporting errors
|
||||
pw.warnings, pw.err = progressui.DisplaySolveStatus(ctx, c, w, pw.status, opt.displayOpts...)
|
||||
resumeLogs()
|
||||
|
|
Loading…
Reference in New Issue