Skip to content

Commit a469fb4

Browse files
committed
test(embedding): avoid loop-condition lint in stream proof
1 parent 5635761 commit a469fb4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/plugins/openai-compatible-embedding-provider.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ async function startOversizedSuccessEmbeddingServer(): Promise<OversizedStreamSe
219219
if (!(await writeChunk(prefix))) {
220220
return;
221221
}
222-
while (bodyBytesSent < plannedBodyBytes) {
222+
const chunksToSend = Math.ceil((plannedBodyBytes - bodyBytesSent) / chunk.byteLength);
223+
for (let i = 0; i < chunksToSend; i++) {
223224
if (!(await writeChunk(chunk))) {
224225
return;
225226
}

0 commit comments

Comments
 (0)