Skip to content

Fix download timeout: use 10min HttpClient and ResponseHeadersRead#10

Open
bryanwong1 wants to merge 1 commit into
bootstrapmate:mainfrom
bryanwong1:fix/download-timeout-httpclient
Open

Fix download timeout: use 10min HttpClient and ResponseHeadersRead#10
bryanwong1 wants to merge 1 commit into
bootstrapmate:mainfrom
bryanwong1:fix/download-timeout-httpclient

Conversation

@bryanwong1

Copy link
Copy Markdown

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts package download behavior in Program.cs to prevent large/slow downloads from failing due to the default HttpClient timeout, by streaming the response body and increasing the configured timeout.

Changes:

  • Set a 10-minute HttpClient.Timeout for package downloads.
  • Use HttpCompletionOption.ResponseHeadersRead to begin streaming the download to disk as soon as headers arrive.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Program.cs
Comment on lines +984 to +988
// Use a 10-minute timeout so large MSIs (e.g. CimianTools ARM64) don't hit
// the 100-second HttpClient default on slow links. ResponseHeadersRead lets
// GetAsync return as soon as headers arrive; the body streams via CopyToAsync
// which is not subject to HttpClient.Timeout.
using var httpClient = new HttpClient { Timeout = TimeSpan.FromMinutes(10) };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants