react-component / upload

React Upload
https://upload.react-component.vercel.app/
MIT License
784 stars 319 forks source link

feat: support concurrency limit #542

Open thep0y opened 10 months ago

thep0y commented 10 months ago

When enabling multi-file upload, you can control the concurrency by providing the concurrencyLimit property.

The concurrencyLimit property creates a ConcurrencyRequester instance, storing all requests in the instance's queue. The concurrent upload task quantity is restricted by the concurrencyLimit when using the send method of the instance at the end of the uploadFiles process.

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
upload ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2024 4:14am
codecov[bot] commented 10 months ago

Codecov Report

Attention: Patch coverage is 36.36364% with 49 lines in your changes missing coverage. Please review.

Project coverage is 75.07%. Comparing base (6027d4c) to head (89f3d6b). Report is 2 commits behind head on master.

Files Patch % Lines
src/concurrencyRequest.ts 0.00% 44 Missing :warning:
src/AjaxUploader.tsx 66.66% 3 Missing :warning:
src/request.ts 91.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #542 +/- ## =========================================== - Coverage 87.21% 75.07% -12.15% =========================================== Files 6 7 +1 Lines 266 325 +59 Branches 72 79 +7 =========================================== + Hits 232 244 +12 - Misses 34 81 +47 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

afc163 commented 9 months ago

覆盖率得想办法补一下。

thep0y commented 9 months ago

覆盖率得想办法补一下。

试过了,并发请求的测试实再不知道怎么写

afc163 commented 8 months ago

ref https://github.com/ant-design/ant-design/issues/28950

afc163 commented 8 months ago

@zombieJ 这个的用例来帮忙补一下?

narimanshariat commented 5 months ago

This could be a useful feature to control browser resource usage with batch file uploads. Any chance this would be merged?