master
cheetah 1 year ago
parent 2efe33a1da
commit e70dbb5a81

@ -343,7 +343,7 @@ func modeIngress(folderPath string, skipN int) {
defer tracker.Increment(1) defer tracker.Increment(1)
err = ProcessGMA(pw, jobFile) err = ProcessGMA(pw, jobFile)
if err != nil { if err != nil {
log.Printf("\nERROR: %v\n", err) pw.Log(fmt.Sprintf("\nERROR: %v\n", err))
} }
}(jobFile, &wg) }(jobFile, &wg)
@ -400,6 +400,7 @@ func ProcessGMA(pw progress.Writer, filePath string) (err error) {
} }
defer cursor.Close() defer cursor.Close()
initialRetryCounter := 0
skipHashCheck := false skipHashCheck := false
if cursor.Count() > 0 || cursor.HasMore() { if cursor.Count() > 0 || cursor.HasMore() {
for { for {
@ -413,7 +414,15 @@ func ProcessGMA(pw progress.Writer, filePath string) (err error) {
if gma.Success { if gma.Success {
return fmt.Errorf("GMA with ID %s was successfull at %v", gma.ID, gma.ProcessingEnd) return fmt.Errorf("GMA with ID %s was successfull at %v", gma.ID, gma.ProcessingEnd)
} else { } else {
if gma.RetryCounter > 3 {
return fmt.Errorf("GMA with ID %s was too many times unsuccessfull", gma.ID)
}
skipHashCheck = true skipHashCheck = true
initialRetryCounter = gma.RetryCounter + 1
_, err = colGMA.UpdateDocument(arangoCTX, gma.ID, &gma)
if err != nil {
return err
}
} }
} }
} }
@ -424,6 +433,7 @@ func ProcessGMA(pw progress.Writer, filePath string) (err error) {
} }
dboGMA.StatModTime = fileStat.ModTime() dboGMA.StatModTime = fileStat.ModTime()
dboGMA.GMASize = fileStat.Size() dboGMA.GMASize = fileStat.Size()
dboGMA.RetryCounter = initialRetryCounter + 1
if dboGMA.GMASize < 200 { if dboGMA.GMASize < 200 {
return fmt.Errorf("GMA File too small, skipping") return fmt.Errorf("GMA File too small, skipping")
@ -557,7 +567,7 @@ func ProcessGMA(pw progress.Writer, filePath string) (err error) {
trackerProcess.Increment(1) trackerProcess.Increment(1)
} }
if len(files) < 1 { if len(files) < 1 {
return fmt.Errorf("GMA empty, len=%d", len(files)) return fmt.Errorf("GMA %s empty, len=%d", dboGMA.OriginalPath, len(files))
} }
lastFile := files[len(files)-1] lastFile := files[len(files)-1]

Loading…
Cancel
Save