(httpClient *http.Client, logURL string)
| 468 | } |
| 469 | |
| 470 | func getLog(httpClient *http.Client, logURL string) (io.ReadCloser, error) { |
| 471 | req, err := http.NewRequest("GET", logURL, nil) |
| 472 | if err != nil { |
| 473 | return nil, err |
| 474 | } |
| 475 | |
| 476 | resp, err := httpClient.Do(req) |
| 477 | if err != nil { |
| 478 | return nil, err |
| 479 | } |
| 480 | |
| 481 | if resp.StatusCode == 404 { |
| 482 | return nil, errors.New("log not found") |
| 483 | } else if resp.StatusCode != 200 { |
| 484 | return nil, api.HandleHTTPError(resp) |
| 485 | } |
| 486 | |
| 487 | return resp.Body, nil |
| 488 | } |
| 489 | |
| 490 | func getRunLog(cache RunLogCache, httpClient *http.Client, repo ghrepo.Interface, run *shared.Run, attempt uint64) (*zip.ReadCloser, error) { |
| 491 | cacheKey := fmt.Sprintf("%d-%d", run.ID, run.StartedTime().Unix()) |
no test coverage detected