fixed date comparison
This commit is contained in:
@@ -321,6 +321,7 @@ func (d *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
|
|||||||
select {
|
select {
|
||||||
case demo := <-d.parseDemo:
|
case demo := <-d.parseDemo:
|
||||||
if !d.GCReady {
|
if !d.GCReady {
|
||||||
|
log.Infof("[DL] Postponing match %d (%s): GC not read", demo.MatchId, demo.ShareCode)
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
d.parseDemo <- demo
|
d.parseDemo <- demo
|
||||||
continue
|
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)
|
log.Errorf("[DL] Failure trying to find match %d in db: %v", matchId, e)
|
||||||
}
|
}
|
||||||
} else {
|
} 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)
|
log.Infof("[DL] Match %d is loaded, but not parsed. Try parsing.", demo.MatchId)
|
||||||
demo.MatchId = matchId
|
demo.MatchId = matchId
|
||||||
demo.Url = iMatch.ReplayURL
|
demo.Url = iMatch.ReplayURL
|
||||||
|
Reference in New Issue
Block a user