diff --git a/js/src/client.ts b/js/src/client.ts index ed74f62f..a1eb830d 100644 --- a/js/src/client.ts +++ b/js/src/client.ts @@ -466,9 +466,7 @@ export class Client { private autoBatchTimeout: ReturnType | undefined; - private autoBatchInitialDelayMs = 250; - - private autoBatchAggregationDelayMs = 50; + private autoBatchAggregationDelayMs = 250; private batchSizeBytesLimit?: number; @@ -802,7 +800,6 @@ export class Client { } private async processRunOperation(item: AutoBatchQueueItem) { - const oldTimeout = this.autoBatchTimeout; clearTimeout(this.autoBatchTimeout); this.autoBatchTimeout = undefined; if (item.action === "create") { @@ -814,15 +811,10 @@ export class Client { this.drainAutoBatchQueue(sizeLimitBytes); } if (this.autoBatchQueue.items.length > 0) { - this.autoBatchTimeout = setTimeout( - () => { - this.autoBatchTimeout = undefined; - this.drainAutoBatchQueue(sizeLimitBytes); - }, - oldTimeout - ? this.autoBatchAggregationDelayMs - : this.autoBatchInitialDelayMs - ); + this.autoBatchTimeout = setTimeout(() => { + this.autoBatchTimeout = undefined; + this.drainAutoBatchQueue(sizeLimitBytes); + }, this.autoBatchAggregationDelayMs); } return itemPromise; } diff --git a/js/src/tests/traceable.int.test.ts b/js/src/tests/traceable.int.test.ts index bb3cfd7a..80d6b583 100644 --- a/js/src/tests/traceable.int.test.ts +++ b/js/src/tests/traceable.int.test.ts @@ -696,8 +696,8 @@ test.concurrent( { test1bin: ["application/octet-stream", testAttachment1], test2bin: ["application/octet-stream", testAttachment2], - "input.bin": ["application/octet-stream", attachment], - "input2.bin": [ + inputbin: ["application/octet-stream", attachment], + input2bin: [ "application/octet-stream", new Uint8Array(attachment2), ],