Browse Source

adjust the retry logic

pull/2274/head
Chris Lu 3 years ago
parent
commit
2d519c6cb6
  1. 3
      weed/filer/filechunk_manifest.go

3
weed/filer/filechunk_manifest.go

@ -143,6 +143,7 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, cipherKe
writer.Write(data)
written += len(data)
})
shouldRetry = shouldRetry && written == 0
if !shouldRetry {
break
}
@ -155,7 +156,7 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, cipherKe
break
}
}
if err != nil && shouldRetry && written > 0 {
if err != nil && shouldRetry {
glog.V(0).Infof("retry reading in %v", waitTime)
time.Sleep(waitTime)
} else {

Loading…
Cancel
Save