Skip to content

Commit

Permalink
wip(webdav): experimenting by inceasing the buffer to 100 MB
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Jul 9, 2024
1 parent 21ca0b4 commit 110cb38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webdav-go/client/api_client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package client

import (
"bufio"
"bytes"
"encoding/json"
"errors"
Expand Down Expand Up @@ -150,7 +151,9 @@ func (cl *APIClient) upload(url, method string, reader io.Reader, name string) (
infra.GetLogger().Error(err.Error())
return
}
if _, err := io.Copy(part, reader); err != nil {
br := bufio.NewReaderSize(reader, 100*1024*1024) // 100 MB buffer
bw := bufio.NewWriterSize(part, 100*1024*1024) // 100 MB buffer
if _, err := io.Copy(bw, br); err != nil {
if err := pw.CloseWithError(err); err != nil {
infra.GetLogger().Error(err.Error())
return
Expand Down

0 comments on commit 110cb38

Please sign in to comment.