Skip to content

Commit

Permalink
Shouldn't call seeker.Seek() if seeker is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertchen committed Nov 3, 2020
1 parent 0baa901 commit 2233fa1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ request_loop:
log.Printf("[DROPBOX_RETRY] %v; retrying after %.2f seconds", err, error_retry_time)
time.Sleep(time.Duration(error_retry_time) * time.Second)
error_retry_time *= 1.5
seeker.Seek(0, io.SeekStart)
if seeker != nil {
seeker.Seek(0, io.SeekStart)
}
continue
}
switch {
Expand All @@ -99,12 +101,16 @@ request_loop:
sleep_time = 60
}
time.Sleep(time.Duration(sleep_time) * time.Second)
seeker.Seek(0, io.SeekStart)
if seeker != nil {
seeker.Seek(0, io.SeekStart)
}
case res.StatusCode >= 500: // Retry on 5xx
log.Printf("[DROPBOX_RETRY] %s %s returned %d; retrying after %.2f seconds", req.Method, req.URL, res.StatusCode, error_retry_time)
time.Sleep(time.Duration(error_retry_time) * time.Second)
error_retry_time *= 1.5
seeker.Seek(0, io.SeekStart)
if seeker != nil {
seeker.Seek(0, io.SeekStart)
}
default:
break request_loop
}
Expand Down

1 comment on commit 2233fa1

@gilbertchen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Duplicacy Forum. There might be relevant details there:

https://forum.duplicacy.com/t/cli-2-7-2-is-now-available/4483/1

Please sign in to comment.