Check if response has data before checking for completion
@@ -123,6 +123,7 @@ func pollBuildStatus(logUrl string, out io.Writer) error {
}
resp.Body.Close()
+ if offset > 0 {
switch resp.Header.Get(BUILD_STATUS_HEADER) {
case "": //run succeeded when there is no status header
return nil
@@ -134,6 +135,7 @@ func pollBuildStatus(logUrl string, out io.Writer) error {
case "canceled":
return errors.New("run was canceled")
}
+ }
time.Sleep(2 * time.Second)
}
