mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -08:00
🐛 Fixed batch sizing to work when batchSize = 1 (#1314)
This commit is contained in:
parent
af414d77fb
commit
9c479abc35
|
@ -656,7 +656,7 @@ export class HttpRequest implements INodeType {
|
||||||
if (itemIndex > 0 && options.batchSize as number >= 0 && options.batchInterval as number > 0) {
|
if (itemIndex > 0 && options.batchSize as number >= 0 && options.batchInterval as number > 0) {
|
||||||
// defaults batch size to 1 of it's set to 0
|
// defaults batch size to 1 of it's set to 0
|
||||||
const batchSize: number = options.batchSize as number > 0 ? options.batchSize as number : 1;
|
const batchSize: number = options.batchSize as number > 0 ? options.batchSize as number : 1;
|
||||||
if (itemIndex % batchSize === 1) {
|
if (itemIndex % batchSize === 0) {
|
||||||
await new Promise(resolve => setTimeout(resolve, options.batchInterval as number));
|
await new Promise(resolve => setTimeout(resolve, options.batchInterval as number));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue