Remove downloaded result on json failure
This commit is contained in:
parent
776ca68e3e
commit
50fcfb9513
3
cv/cv.go
3
cv/cv.go
@ -282,7 +282,8 @@ func (c *CVDownloader) updateIssues() {
|
|||||||
}
|
}
|
||||||
body := io.TeeReader(resp.Body, file)
|
body := io.TeeReader(resp.Body, file)
|
||||||
err = json.NewDecoder(bufio.NewReader(body)).Decode(issue)
|
err = json.NewDecoder(bufio.NewReader(body)).Decode(issue)
|
||||||
if err != nil {
|
if err != nil || issue.Offset != offset {
|
||||||
|
os.Remove(filepath.Join(c.JSONPath, "cv-"+strconv.Itoa(offset)+".json"))
|
||||||
cancelDownloadCTX()
|
cancelDownloadCTX()
|
||||||
if retry(URI.String(), err) {
|
if retry(URI.String(), err) {
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user