Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chunk-upload retry #182

Merged
merged 16 commits into from
Feb 27, 2024
Merged

Add chunk-upload retry #182

merged 16 commits into from
Feb 27, 2024

Conversation

oliverroick
Copy link
Contributor

Implements re-trying for failing chunk uploads.

I took the AWS example and implemented it the following way

  • sendNext starts a new chunk upload. It pops on element form the parts array and starts the upload by calling sendChunk.
  • sendChunk initialises the XHR object and returns a promise that resolves if the upload succeeds and rejects when not.
  • If the upload fails, we push the failed a request back into parts and call sendNext after a short timeout.
  • If no more parts are available and there are no ongoing uploads, we call complete to wrap up the upload.

@nathanielrindlaub nathanielrindlaub merged commit e3fac27 into main Feb 27, 2024
2 checks passed
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