Skip to content

Commit 1df14d3

Browse files
committed
fix: parallelChunkUploads should respect parallelUploads
fix dropzone#2030 based on PR dropzone#2249 by @labor4
1 parent babeb39 commit 1df14d3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/dropzone.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,12 @@ export default class Dropzone extends Emitter {
12771277
};
12781278

12791279
if (this.options.parallelChunkUploads) {
1280-
for (let i = 0; i < file.upload.totalChunkCount; i++) {
1280+
// we want to limit parallelChunkUploads to the same value as parallelUploads option
1281+
const parallelCount = Math.min(
1282+
this.options.parallelChunkUploads === true ? this.options.parallelUploads : this.options.parallelChunkUploads,
1283+
file.upload.totalChunkCount
1284+
);
1285+
for (let i = 0; i < parallelCount; i++) {
12811286
handleNextChunk();
12821287
}
12831288
} else {

src/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ let defaultOptions = {
6565

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

0 commit comments

Comments
 (0)