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