fixed logging, try demo before returning

This commit is contained in:
2021-10-17 19:09:31 +02:00
parent b0a1dd9b4b
commit a5de6d6584

View File

@@ -121,17 +121,16 @@ func (p *DemoParser) parseWorker() {
continue
}
if tMatch.Date.Before(time.Now().UTC().AddDate(0, 0, -30)) {
log.Infof("[DP] skipped already exipred demo for match %d", tMatch.ID)
continue
}
startTime := time.Now()
fDemo, err := p.downloadReplay(demo)
if err != nil {
switch e := err.(type) {
case DemoNotFoundError:
log.Infof("[DP] Demo 404 not found for %d. Trying agian later.", demo.MatchId)
if tMatch.Date.Before(time.Now().UTC().AddDate(0, 0, -30)) {
log.Infof("[DP] demo expired for match %d", tMatch.ID)
} else {
log.Infof("[DP] Demo 404 not found for %d. Trying again later.", demo.MatchId)
}
continue
default:
log.Errorf("[DP] Unable to download demo for %d: %v", demo.MatchId, e)