Skip to content

Commit

Permalink
chore: why are we here
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Dec 23, 2023
1 parent bc87c81 commit 920e40a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/cache/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func DownloadOrCache(cacheKey string, hash string, url string, updates chan<- ut
}
}()

slog.Debug("starting download", slog.String("url", url), slog.String("location", location))
size, err := downloadInternal(cacheKey, location, hash, url, upstreamUpdates, downloadSemaphore)
if err != nil {
group.err = err
Expand Down Expand Up @@ -154,6 +155,7 @@ func downloadInternal(cacheKey string, location string, hash string, url string,
return 0, fmt.Errorf("failed to head: %s: %w", url, err)
}
defer headResp.Body.Close()
slog.Debug("sending start", slog.Int64("length", headResp.ContentLength))
updates <- utils.GenericProgress{Total: headResp.ContentLength}
}

Expand Down Expand Up @@ -191,6 +193,7 @@ func downloadInternal(cacheKey string, location string, hash string, url string,
_ = out.Sync()

if updates != nil {
slog.Debug("sending end", slog.Int64("length", resp.ContentLength))
updates <- utils.GenericProgress{Completed: resp.ContentLength, Total: resp.ContentLength}
}

Expand Down

0 comments on commit 920e40a

Please sign in to comment.