tardis-machine
Advanced tools
Comparing version 3.28.0 to 3.28.1
@@ -41,2 +41,3 @@ "use strict"; | ||
const responseSuffixBuffer = Buffer.from('}\n'); | ||
const newLineBuffer = Buffer.from('\n'); | ||
const BATCH_SIZE = 32; | ||
@@ -53,3 +54,3 @@ // not 100% sure that's necessary since we're returning ndjson in fact, not json | ||
// return it as new line | ||
res.write('\n'); | ||
buffers.push(newLineBuffer); | ||
} | ||
@@ -61,3 +62,3 @@ else { | ||
buffers.push(responsePrefixBuffer, messageWithTimestamp.localTimestamp, responseMiddleBuffer, messageWithTimestamp.message, responseSuffixBuffer); | ||
if (buffers.length == BATCH_SIZE * 5) { | ||
if (buffers.length >= BATCH_SIZE * 5) { | ||
const ok = res.write(Buffer.concat(buffers)); | ||
@@ -64,0 +65,0 @@ buffers = []; |
{ | ||
"name": "tardis-machine", | ||
"version": "3.28.0", | ||
"version": "3.28.1", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=12" |
@@ -46,2 +46,3 @@ import { once } from 'events' | ||
const responseSuffixBuffer = Buffer.from('}\n') | ||
const newLineBuffer = Buffer.from('\n') | ||
const BATCH_SIZE = 32 | ||
@@ -63,3 +64,3 @@ | ||
// return it as new line | ||
res.write('\n') | ||
buffers.push(newLineBuffer) | ||
} else { | ||
@@ -77,3 +78,3 @@ // instead of writing each message directly to response, | ||
if (buffers.length == BATCH_SIZE * 5) { | ||
if (buffers.length >= BATCH_SIZE * 5) { | ||
const ok = res.write(Buffer.concat(buffers)) | ||
@@ -80,0 +81,0 @@ buffers = [] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
189069
3309