mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
util: simplify progress syncronization
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@ -11,7 +11,6 @@ import (
|
||||
)
|
||||
|
||||
func FromReader(w Writer, name string, rc io.ReadCloser) {
|
||||
status := w.Status()
|
||||
dgst := digest.FromBytes([]byte(identity.NewID()))
|
||||
tm := time.Now()
|
||||
|
||||
@ -21,9 +20,9 @@ func FromReader(w Writer, name string, rc io.ReadCloser) {
|
||||
Started: &tm,
|
||||
}
|
||||
|
||||
status <- &client.SolveStatus{
|
||||
w.Write(&client.SolveStatus{
|
||||
Vertexes: []*client.Vertex{&vtx},
|
||||
}
|
||||
})
|
||||
|
||||
_, err := io.Copy(ioutil.Discard, rc)
|
||||
|
||||
@ -33,8 +32,7 @@ func FromReader(w Writer, name string, rc io.ReadCloser) {
|
||||
if err != nil {
|
||||
vtx2.Error = err.Error()
|
||||
}
|
||||
status <- &client.SolveStatus{
|
||||
w.Write(&client.SolveStatus{
|
||||
Vertexes: []*client.Vertex{&vtx2},
|
||||
}
|
||||
close(status)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user