fixed date comparison

This commit is contained in:
2021-10-09 19:42:09 +02:00
parent ea0fd3459c
commit 563d7e6fd4

View File

@@ -321,6 +321,7 @@ func (d *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
select {
case demo := <-d.parseDemo:
if !d.GCReady {
log.Infof("[DL] Postponing match %d (%s): GC not read", demo.MatchId, demo.ShareCode)
time.Sleep(5 * time.Second)
d.parseDemo <- demo
continue
@@ -343,7 +344,7 @@ func (d *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
log.Errorf("[DL] Failure trying to find match %d in db: %v", matchId, e)
}
} else {
if iMatch.DemoParsed == false && iMatch.Date.Before(time.Now().UTC().AddDate(0, 0, -30)) {
if iMatch.DemoParsed == false && iMatch.Date.After(time.Now().UTC().AddDate(0, 0, -30)) {
log.Infof("[DL] Match %d is loaded, but not parsed. Try parsing.", demo.MatchId)
demo.MatchId = matchId
demo.Url = iMatch.ReplayURL