mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix flush
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
parent
9dcbdbc4b1
commit
90e9a2d85a
2 changed files with 13 additions and 1 deletions
|
@ -109,6 +109,18 @@ func (o *Output) Write(p []byte) (n int, err error) {
|
||||||
return len(p), firstErr
|
return len(p), firstErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *Output) Flush() {
|
||||||
|
o.Mutex.Lock()
|
||||||
|
defer o.Mutex.Unlock()
|
||||||
|
for _, dst := range o.dests {
|
||||||
|
if f, ok := dst.(interface {
|
||||||
|
Flush()
|
||||||
|
}); ok {
|
||||||
|
f.Flush()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Close unregisters all destinations and waits for all background
|
// Close unregisters all destinations and waits for all background
|
||||||
// AddTail and AddString tasks to complete.
|
// AddTail and AddString tasks to complete.
|
||||||
// The Close method of each destination is called if it exists.
|
// The Close method of each destination is called if it exists.
|
||||||
|
|
|
@ -1324,7 +1324,7 @@ func (srv *Server) ImagePull(job *engine.Job) engine.Status {
|
||||||
tag string
|
tag string
|
||||||
sf = utils.NewStreamFormatter(job.GetenvBool("json"))
|
sf = utils.NewStreamFormatter(job.GetenvBool("json"))
|
||||||
out = utils.NewWriteFlusher(job.Stdout)
|
out = utils.NewWriteFlusher(job.Stdout)
|
||||||
authConfig *auth.AuthConfig
|
authConfig = &auth.AuthConfig{}
|
||||||
metaHeaders map[string][]string
|
metaHeaders map[string][]string
|
||||||
)
|
)
|
||||||
if len(job.Args) > 1 {
|
if len(job.Args) > 1 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue