Skip to content

chore: add throttle for download and upload operations#19

Merged
2-towns merged 1 commit intomasterfrom
chore/add-throttle-to-upload-download
Mar 18, 2026
Merged

chore: add throttle for download and upload operations#19
2-towns merged 1 commit intomasterfrom
chore/add-throttle-to-upload-download

Conversation

@2-towns
Copy link
Collaborator

@2-towns 2-towns commented Mar 6, 2026

This PR adds throttle for download and upload operation in order to better handle big files.

@2-towns 2-towns requested a review from emizzle March 6, 2026 05:38
Copy link
Collaborator

@emizzle emizzle left a comment

Choose a reason for hiding this comment

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

Nice work Arnaud!

//
// Progress events are throttled to at most one per percentage point (max 100
// events total) to avoid flooding the caller with events on every block.
// When totalBytes is 0 (unknown), every event is forwarded without throttling.
Copy link
Collaborator

Choose a reason for hiding this comment

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

When would totalBytes be zero? I don't think the manifest will ever be missing this information, but i guess it doesn't hurt to have this contingency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If the manifest download failed for some reason, or if downloadChunks is called directly, not internally by downloadToUrl.

@2-towns 2-towns merged commit 3687477 into master Mar 18, 2026
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