mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-27 01:51:56 +08:00
fix: OneDrive chunk upload time should be 0, avoiding upload timeouts when chunk size is large
This commit is contained in:
@@ -230,7 +230,7 @@ func (client *Client) UploadChunk(ctx context.Context, uploadURL string, content
|
|||||||
"Content-Range": {current.RangeHeader()},
|
"Content-Range": {current.RangeHeader()},
|
||||||
}),
|
}),
|
||||||
request.WithoutHeader([]string{"Authorization", "Content-Type"}),
|
request.WithoutHeader([]string{"Authorization", "Content-Type"}),
|
||||||
request.WithTimeout(time.Duration(300)*time.Second),
|
request.WithTimeout(0),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to upload OneDrive chunk #%d: %w", current.Index(), err)
|
return nil, fmt.Errorf("failed to upload OneDrive chunk #%d: %w", current.Index(), err)
|
||||||
@@ -320,7 +320,7 @@ func (client *Client) SimpleUpload(ctx context.Context, dst string, body io.Read
|
|||||||
requestURL += ("?@microsoft.graph.conflictBehavior=" + options.conflictBehavior)
|
requestURL += ("?@microsoft.graph.conflictBehavior=" + options.conflictBehavior)
|
||||||
|
|
||||||
res, err := client.request(ctx, "PUT", requestURL, body, request.WithContentLength(int64(size)),
|
res, err := client.request(ctx, "PUT", requestURL, body, request.WithContentLength(int64(size)),
|
||||||
request.WithTimeout(time.Duration(150)*time.Second),
|
request.WithTimeout(0),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user