skip matches already expired

This commit is contained in:
2021-10-17 19:00:01 +02:00
parent aa6eb72edf
commit b0a1dd9b4b

View File

@@ -121,15 +121,20 @@ 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.Warningf("[DP] Demo not found for %d. Maybe temp.?", demo.MatchId)
log.Infof("[DP] Demo 404 not found for %d. Trying agian later.", demo.MatchId)
continue
default:
log.Warningf("[DP] Unable to download demo for %d: %v", demo.MatchId, e)
log.Errorf("[DP] Unable to download demo for %d: %v", demo.MatchId, e)
continue
}
}