Feat: generating token and callback url for OSS muiltpart upload, support resume upload in sever-side uploading for OSS

This commit is contained in:
HFO4
2022-03-20 11:23:55 +08:00
parent 015ccd5026
commit 0df9529b32
13 changed files with 146 additions and 82 deletions

View File

@@ -279,7 +279,7 @@ func (client *Client) Upload(ctx context.Context, file fsctx.FileHeader) error {
// Initial chunk groups
chunks := chunk.NewChunkGroup(file, client.Policy.OptionsSerialized.ChunkSize, &backoff.ConstantBackoff{
Max: model.GetIntSetting("onedrive_chunk_retries", 5),
Max: model.GetIntSetting("chunk_retries", 5),
Sleep: chunkRetrySleep,
})
@@ -327,7 +327,7 @@ func (client *Client) SimpleUpload(ctx context.Context, dst string, body io.Read
if v, ok := ctx.Value(fsctx.RetryCtx).(int); ok {
retried = v
}
if retried < model.GetIntSetting("onedrive_chunk_retries", 5) {
if retried < model.GetIntSetting("chunk_retries", 5) {
retried++
util.Log().Debug("文件[%s]上传失败[%s]5秒钟后重试", dst, err)
time.Sleep(time.Duration(5) * time.Second)