commit 234176cd47e37861adf29d7cdaeb917982ea7779
parent 80284583338b2dd496688fb4307a79985a86f52b
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 30 Jan 2023 23:18:48 -0800
when client timeout, get a new client
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/cmd/dkfupload/main.go b/cmd/dkfupload/main.go
@@ -168,6 +168,9 @@ func work(i int, wg *sync.WaitGroup, chunksCh chan int64, isLocal, dry bool, max
req.Header.Set("Content-Type", w.FormDataContentType())
resp, err := client.Do(req)
if err != nil {
+ if os.IsTimeout(err) {
+ client = doGetClient(isLocal, httpTimeout)
+ }
return err
}
defer resp.Body.Close()