fixing major fuckup

master
cheetah 1 year ago
parent 4e82da5e61
commit 72082994e4

@ -636,6 +636,32 @@ func ProcessGMA(pw progress.Writer, filePath string) (err error) {
//fmt.Printf("res.StatusCode = %d\n", res.StatusCode)
if res.StatusCode == http.StatusAlreadyReported {
trackerUpload.UpdateMessage(fmt.Sprintf("Skipping %s", niceName))
for _, dboGMA2File := range dboGMA2Files {
if dboFileID == dboGMA2File.File {
// Create File and dboGMA2File Object
exists, err := colGMA2File.DocumentExists(arangoCTX, dboGMA2File.ID)
if err != nil {
log.Println("err @colGMA2File.DocumentExists")
log.Println("oopsie")
undoBatch(true, dboGMA.ID, fileIDs, gma2FileIDs)
trackerUpload.MarkAsErrored()
return err
}
if !exists {
_, err = colGMA2File.CreateDocument(arangoCTX, dboGMA2File)
if err != nil {
log.Println("err @colGMA2File.CreateDocument")
log.Println("oopsie")
undoBatch(true, dboGMA.ID, fileIDs, gma2FileIDs)
trackerUpload.MarkAsErrored()
return err
}
}
break
}
}
trackerUpload.Increment(1)
continue
}

Loading…
Cancel
Save