From b9a6f0f5de8ec63e77d7bc849d43b7f270f2a101 Mon Sep 17 00:00:00 2001 From: hdthinh1012 Date: Thu, 26 Sep 2024 09:21:23 +0700 Subject: [PATCH] fix code --- content/4-Code-explanation/4.2-detail/_index.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/content/4-Code-explanation/4.2-detail/_index.md b/content/4-Code-explanation/4.2-detail/_index.md index 9fde3ed..26a5e6d 100644 --- a/content/4-Code-explanation/4.2-detail/_index.md +++ b/content/4-Code-explanation/4.2-detail/_index.md @@ -271,12 +271,10 @@ export class AWSS3FileReadStream extends Readable { Body.transformToByteArray() .then((chunk) => { this.chunksConcat(chunk); - if (this.chunks.byteLength >= this.highWaterMark) { - let uploadingChunk = this.chunks; - this.chunks = new Uint8Array(0); - console.log('read stream push chunk', uploadingChunk); - this.push(uploadingChunk); - } + let uploadingChunk = this.chunks; + this.chunks = new Uint8Array(0); + console.log('read stream push chunk', uploadingChunk); + this.push(uploadingChunk); }) .catch((error) => { console.log('Body.transformToByteArray() error', error);