mirror of
https://gitee.com/zhangsken/aliyunpan.git
synced 2026-10-16 02:23:49 +08:00
fix uploadEntity.PartInfoList len 0 error
This commit is contained in:
@@ -72,6 +72,10 @@ func (pu *PanUpload) Precreate() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pu *PanUpload) UploadFile(ctx context.Context, partseq int, partOffset int64, partEnd int64, r rio.ReaderLen64, uploadClient *requester.HTTPClient) (uploadDone bool, uperr error) {
|
func (pu *PanUpload) UploadFile(ctx context.Context, partseq int, partOffset int64, partEnd int64, r rio.ReaderLen64, uploadClient *requester.HTTPClient) (uploadDone bool, uperr error) {
|
||||||
|
if len(pu.uploadOpEntity.PartInfoList) == 0 {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
pu.lazyInit()
|
pu.lazyInit()
|
||||||
|
|
||||||
// check url expired or not
|
// check url expired or not
|
||||||
|
|||||||
@@ -528,6 +528,15 @@ func (f *FileActionTask) uploadFile(ctx context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if len(f.syncItem.UploadEntity.PartInfoList) == 0 {
|
||||||
|
// finished
|
||||||
|
f.syncItem.Status = SyncFileStatusSuccess
|
||||||
|
f.syncItem.StatusUpdateTime = utils.NowTimeStr()
|
||||||
|
f.syncFileDb.Update(f.syncItem)
|
||||||
|
|
||||||
|
PromptPrintln("上传完毕:" + f.syncItem.getPanFileFullPath())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
// 检测链接是否过期
|
// 检测链接是否过期
|
||||||
// check url expired or not
|
// check url expired or not
|
||||||
uploadUrl := f.syncItem.UploadEntity.PartInfoList[f.syncItem.UploadPartSeq].UploadURL
|
uploadUrl := f.syncItem.UploadEntity.PartInfoList[f.syncItem.UploadPartSeq].UploadURL
|
||||||
|
|||||||
Reference in New Issue
Block a user