From ba607163909313d65a443db720c3bb77addf5e33 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Sun, 5 Jun 2022 01:21:50 +0800 Subject: [PATCH] server: fix upload chunk --- packages/server/src/helpers/file.helper/tencent.client.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/server/src/helpers/file.helper/tencent.client.ts b/packages/server/src/helpers/file.helper/tencent.client.ts index c416dd44..10a1d9c8 100644 --- a/packages/server/src/helpers/file.helper/tencent.client.ts +++ b/packages/server/src/helpers/file.helper/tencent.client.ts @@ -132,6 +132,7 @@ export class TencentOssClient extends BaseOssClient { } else { const uploadId = data.UploadId; this.uploadIdMap.set(inOssFileName, uploadId); + this.uploadChunkEtagMap.set(uploadId, []); resolve(uploadId); } }); @@ -161,9 +162,6 @@ export class TencentOssClient extends BaseOssClient { if (err) { reject(err); } else { - if (!this.uploadChunkEtagMap.has(uploadId)) { - this.uploadChunkEtagMap.set(uploadId, []); - } this.uploadChunkEtagMap.get(uploadId).push({ PartNumber: chunkIndex, ETag: data.ETag,