From b0a1dd9b4b08026870903c9bf2438d8e346e0264 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Sun, 17 Oct 2021 19:00:01 +0200 Subject: [PATCH] skip matches already expired --- csgo/demo_parser.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/csgo/demo_parser.go b/csgo/demo_parser.go index c1a45ea..51b0764 100644 --- a/csgo/demo_parser.go +++ b/csgo/demo_parser.go @@ -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 } }