Skip to content

Commit

Permalink
fix: parallelChunkUploads should respect parallelUploads
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Apr 23, 2024
1 parent babeb39 commit 1df14d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,12 @@ export default class Dropzone extends Emitter {
};

if (this.options.parallelChunkUploads) {
for (let i = 0; i < file.upload.totalChunkCount; i++) {
// we want to limit parallelChunkUploads to the same value as parallelUploads option
const parallelCount = Math.min(
this.options.parallelChunkUploads === true ? this.options.parallelUploads : this.options.parallelChunkUploads,
file.upload.totalChunkCount
);
for (let i = 0; i < parallelCount; i++) {
handleNextChunk();
}
} else {
Expand Down
1 change: 1 addition & 0 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ let defaultOptions = {

/**
* If `true`, the individual chunks of a file are being uploaded simultaneously.
* The limit of concurrent connections is governed by `parallelUploads`.
*/
parallelChunkUploads: false,

Expand Down

0 comments on commit 1df14d3

Please sign in to comment.