server: fix upload chunk

This commit is contained in:
fantasticit 2022-06-05 01:21:50 +08:00
parent 21966051a4
commit ba60716390
1 changed files with 1 additions and 3 deletions

View File

@ -132,6 +132,7 @@ export class TencentOssClient extends BaseOssClient {
} else { } else {
const uploadId = data.UploadId; const uploadId = data.UploadId;
this.uploadIdMap.set(inOssFileName, uploadId); this.uploadIdMap.set(inOssFileName, uploadId);
this.uploadChunkEtagMap.set(uploadId, []);
resolve(uploadId); resolve(uploadId);
} }
}); });
@ -161,9 +162,6 @@ export class TencentOssClient extends BaseOssClient {
if (err) { if (err) {
reject(err); reject(err);
} else { } else {
if (!this.uploadChunkEtagMap.has(uploadId)) {
this.uploadChunkEtagMap.set(uploadId, []);
}
this.uploadChunkEtagMap.get(uploadId).push({ this.uploadChunkEtagMap.get(uploadId).push({
PartNumber: chunkIndex, PartNumber: chunkIndex,
ETag: data.ETag, ETag: data.ETag,