diff --git a/src/cli/commands/add.js b/src/cli/commands/add.js index a76ba3a7f8..3bfe6f9866 100644 --- a/src/cli/commands/add.js +++ b/src/cli/commands/add.js @@ -113,7 +113,7 @@ module.exports = { argv.resolve((async () => { const ipfs = await argv.getIpfs() const options = { - strategy: argv.trickle ? 'trickle' : 'balanced', + trickle: argv.trickle, shardSplitThreshold: argv.enableShardingExperiment ? argv.shardSplitThreshold : Infinity, diff --git a/src/core/components/files-regular/add-async-iterator.js b/src/core/components/files-regular/add-async-iterator.js index c5ab26bb38..e138a1cd66 100644 --- a/src/core/components/files-regular/add-async-iterator.js +++ b/src/core/components/files-regular/add-async-iterator.js @@ -21,6 +21,7 @@ module.exports = function (self) { ? 1000 : Infinity }, options, { + strategy: 'balanced', chunker: chunkerOptions.chunker, chunkerOptions: chunkerOptions.chunkerOptions }) @@ -30,6 +31,12 @@ module.exports = function (self) { opts.cidVersion = 1 } + if (opts.trickle) { + opts.strategy = 'trickle' + } + + delete opts.trickle + let total = 0 const prog = opts.progress || noop diff --git a/src/http/api/resources/files-regular.js b/src/http/api/resources/files-regular.js index 4aadc8f041..d71842b3ac 100644 --- a/src/http/api/resources/files-regular.js +++ b/src/http/api/resources/files-regular.js @@ -219,7 +219,7 @@ exports.add = { wrapWithDirectory: request.query['wrap-with-directory'], pin: request.query.pin, chunker: request.query.chunker, - strategy: request.query.trickle ? 'trickle' : 'balanced', + trickle: request.query.trickle, preload: request.query.preload }) },