feat: add retry logic and extended timeouts for large file downloads#91
Merged
flexiondotorg merged 1 commit intomainfrom Jan 22, 2026
Merged
feat: add retry logic and extended timeouts for large file downloads#91flexiondotorg merged 1 commit intomainfrom
flexiondotorg merged 1 commit intomainfrom
Conversation
- Add automatic retry mechanism with exponential backoff (3 retries max) - Implement automatic resume on retry by re-checking file size - Extend connection timeout to 10 minutes for large file downloads - Add connection pooling and TCP keepalive settings - Refactor download_file_content to handle transient network errors - Simplify function signature by removing explicit file_size parameter Addresses issues: - #76: Large files downloading with incorrect size/hash errors - #89: Connection errors during download ('error decoding response body') Changes from PR #86 by @ApfelTeeSaft
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/main.rs">
<violation number="1" location="src/main.rs:25">
P2: Magic number `60` should use the existing `HTTP_TIMEOUT` constant. The PR removed the import but hardcoded the same value, which defeats the purpose of having the constant and makes future maintenance harder.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| let response = client | ||
| .head(url) | ||
| .timeout(std::time::Duration::from_secs(HTTP_TIMEOUT)) | ||
| .timeout(std::time::Duration::from_secs(60)) |
Contributor
There was a problem hiding this comment.
P2: Magic number 60 should use the existing HTTP_TIMEOUT constant. The PR removed the import but hardcoded the same value, which defeats the purpose of having the constant and makes future maintenance harder.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/main.rs, line 25:
<comment>Magic number `60` should use the existing `HTTP_TIMEOUT` constant. The PR removed the import but hardcoded the same value, which defeats the purpose of having the constant and makes future maintenance harder.</comment>
<file context>
@@ -8,18 +8,21 @@
let response = client
.head(url)
- .timeout(std::time::Duration::from_secs(HTTP_TIMEOUT))
+ .timeout(std::time::Duration::from_secs(60))
.send()
.await?;
</file context>
Contributor
There was a problem hiding this comment.
I've fixed the magic number issue by replacing the hardcoded 60 with the existing HTTP_TIMEOUT constant from ia_get::constants.
Changes made:
- Added
HTTP_TIMEOUTto the import statement on line 11 - Replaced
60withHTTP_TIMEOUTon line 25
This ensures consistency with the defined constant and makes future maintenance easier.
PR: #92
This was referenced Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses issues:
Changes from PR #86 by @ApfelTeeSaft
Summary by cubic
Adds automatic retry with exponential backoff and resume, plus longer connection timeouts and keepalive, to make large file downloads reliable. Resolves #76 (size/hash mismatches) and #89 (“error decoding response body”).
New Features
Bug Fixes
Written for commit 74bc8ad. Summary will update on new commits.