File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,16 @@ const { getError } = require('./error')
12
12
// call to those functions would be more efficient that creating lots of
13
13
// child processes through streaming.
14
14
const execStream = function ( mapFunc , opts ) {
15
- const optsA = { ...DEFAULT_OPTS , ...opts }
15
+ const { maxConcurrency , ... optsA } = { ...DEFAULT_OPTS , ...opts }
16
16
17
17
// `maxConcurrency` `through2` option is not specified because `gulp.src()`
18
18
// always has a `highWaterMark` of `16` meaning only 16 files are processed
19
19
// at a time in parallel. `maxConcurrency` can then only be used to decrease
20
20
// that level of parallelism but `16` is already quite low.
21
- return through . obj ( execVinyl . bind ( null , { mapFunc, opts : optsA } ) )
21
+ return through . obj (
22
+ { maxConcurrency } ,
23
+ execVinyl . bind ( null , { mapFunc, opts : optsA } ) ,
24
+ )
22
25
}
23
26
24
27
const DEFAULT_OPTS = {
@@ -29,6 +32,8 @@ const DEFAULT_OPTS = {
29
32
stderr : 'pipe' ,
30
33
// Prevents echoing by default because it would be done on each iteration.
31
34
echo : false ,
35
+ // The default is 16 which is too low
36
+ maxConcurrency : 100 ,
32
37
}
33
38
34
39
// eslint-disable-next-line max-params, promise/prefer-await-to-callbacks
You can’t perform that action at this time.
0 commit comments