mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix logic error
This commit is contained in:
parent
5d01dd28a6
commit
6da8eef54f
|
@ -98,7 +98,7 @@ func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool
|
||||||
var err error
|
var err error
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
|
|
||||||
for waitTime := time.Second; waitTime < 10*time.Minute; waitTime += waitTime / 2 {
|
for waitTime := time.Second; waitTime < 10*time.Second; waitTime += waitTime / 2 {
|
||||||
for _, urlString := range urlStrings {
|
for _, urlString := range urlStrings {
|
||||||
err = util.ReadUrlAsStream(urlString, cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) {
|
err = util.ReadUrlAsStream(urlString, cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) {
|
||||||
buffer.Write(data)
|
buffer.Write(data)
|
||||||
|
@ -110,8 +110,12 @@ func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
glog.V(0).Infof("sleep for %v before retrying reading", waitTime)
|
if err != nil {
|
||||||
time.Sleep(waitTime)
|
glog.V(0).Infof("sleep for %v before retrying reading", waitTime)
|
||||||
|
time.Sleep(waitTime)
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffer.Bytes(), err
|
return buffer.Bytes(), err
|
||||||
|
|
Loading…
Reference in a new issue