fix upload url renew bug

This commit is contained in:
tickstep 2022-01-08 21:57:28 +08:00
parent b63320ec54
commit 4b5a7e9f07

View File

@ -100,7 +100,7 @@ func (pu *PanUpload) UploadFile(ctx context.Context, partseq int, partOffset int
}
if isUrlExpired(uploadUrl) {
// get renew upload url
infoList := make([]aliyunpan.FileUploadPartInfoParam, len(pu.uploadOpEntity.PartInfoList))
infoList := make([]aliyunpan.FileUploadPartInfoParam, 0)
for _,item := range pu.uploadOpEntity.PartInfoList {
infoList = append(infoList, aliyunpan.FileUploadPartInfoParam{
PartNumber: item.PartNumber,
@ -184,6 +184,11 @@ func (pu *PanUpload) UploadFile(ctx context.Context, partseq int, partOffset int
Terminated: true,
}
}
} else {
respError = uploadTerminate
respErr = &uploader.MultiError{
Terminated: true,
}
}
return resp, respError
}