mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 03:41:01 +00:00
added a backoff for streaming output
This commit is contained in:
parent
07672689db
commit
3b8b18fdca
1 changed files with 11 additions and 1 deletions
|
@ -257,7 +257,17 @@ func (r *Runner) Logs(job *types.Job) (io.ReadCloser, error) {
|
|||
// make sure this container actually exists
|
||||
info, err := client.InspectContainer(cname(job))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// add a small exponential backoff since there
|
||||
// is a small window when the container hasn't
|
||||
// been created yet, but the build is about to start
|
||||
for i := 0; ; i++ {
|
||||
time.Sleep(1 * time.Second)
|
||||
info, err = client.InspectContainer(cname(job))
|
||||
if err != nil && i == 5 {
|
||||
return nil, err
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// verify the container is running. if not we'll
|
||||
|
|
Loading…
Reference in a new issue