Upload result ignoring errors

This commit is contained in:
Richard Patel 2018-11-17 15:04:20 +01:00
parent 8060556089
commit 1e6687c519
No known key found for this signature in database
GPG Key ID: C268B2BBDA2ABECB

View File

@ -64,15 +64,8 @@ func PushResult(result *TaskResult, f *os.File) (err error) {
return return
} }
err = uploadResult(result) // Upload result ignoring errors
if err != nil { uploadResult(result)
logrus.Errorf("Failed to upload result: %s", err)
err2 := CancelTask(result.WebsiteId)
if err2 != nil {
logrus.Error(err2)
}
return
}
return return
} }
@ -144,7 +137,7 @@ func uploadResult(result *TaskResult) (err error) {
res.Body.Close() res.Body.Close()
if res.StatusCode != http.StatusOK { if res.StatusCode != http.StatusOK {
return fmt.Errorf("%s", res.Status) return HttpError{res.StatusCode}
} }
return return