mirror of
https://github.com/terorie/od-database-crawler.git
synced 2025-04-18 18:06:45 +00:00
Upload result ignoring errors
This commit is contained in:
parent
8060556089
commit
1e6687c519
13
server.go
13
server.go
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user