add logging

This commit is contained in:
Chris Lu 2020-10-08 23:38:00 -07:00
parent 8d34eb0050
commit 5d01dd28a6

View File

@ -98,7 +98,7 @@ func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool
var err error
var buffer bytes.Buffer
for waitTime := time.Second; waitTime < 10*time.Minute; waitTime+=waitTime/2 {
for waitTime := time.Second; waitTime < 10*time.Minute; waitTime += waitTime / 2 {
for _, urlString := range urlStrings {
err = util.ReadUrlAsStream(urlString, cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) {
buffer.Write(data)
@ -110,6 +110,7 @@ func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool
break
}
}
glog.V(0).Infof("sleep for %v before retrying reading", waitTime)
time.Sleep(waitTime)
}