Skip to content

Commit

Permalink
PutFromFile add retry
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoliang committed Mar 27, 2021
1 parent 5672500 commit 7a8d337
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions object.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ func (s *ObjectService) Put(ctx context.Context, name string, r io.Reader, uopt
func (s *ObjectService) PutFromFile(ctx context.Context, name string, filePath string, opt *ObjectPutOptions) (resp *Response, err error) {
nr := 0
for nr < 3 {
var fd *os.File
fd, err = os.Open(filePath)
if err != nil {
fd, e := os.Open(filePath)
if e != nil {
err = e
return
}
resp, err = s.Put(ctx, name, fd, opt)
Expand Down

0 comments on commit 7a8d337

Please sign in to comment.