Skip to content

Commit

Permalink
feat(baidu): update upload progress
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Sep 11, 2022
1 parent 68a6a0c commit 889ddce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/baidu_netdisk/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (d *BaiduNetdisk) Put(ctx context.Context, dstDir model.Obj, stream model.F
"uploadid": precreateResp.Uploadid,
}
left = stream.GetSize()
for _, partseq := range precreateResp.BlockList {
for i, partseq := range precreateResp.BlockList {
byteSize := Default
var byteData []byte
if left < Default {
Expand All @@ -223,6 +223,9 @@ func (d *BaiduNetdisk) Put(ctx context.Context, dstDir model.Obj, stream model.F
return err
}
log.Debugln(res.String())
if len(precreateResp.BlockList) > 0 {
up(i * 100 / len(precreateResp.BlockList))
}
}
_, err = d.create(path, stream.GetSize(), 0, precreateResp.Uploadid, block_list_str)
return err
Expand Down

0 comments on commit 889ddce

Please sign in to comment.