prevent HK from trying to reparse while parsing is in progress

This commit is contained in:
2022-02-03 17:15:32 +01:00
parent 182c7d8fc1
commit 6a4e2f3ee3
2 changed files with 40 additions and 33 deletions

View File

@@ -174,11 +174,18 @@ func housekeeping() {
}
for _, m := range tMatches {
demoLoader.ParseMapL.Lock()
if _, ok := demoLoader.ParseMap[m.ShareCode]; ok {
log.Infof("[HK] Skipping %s: parsing in progress", m.ShareCode)
demoLoader.ParseMapL.Unlock()
continue
}
log.Infof("[HK] Try reparsing match %d, played on %s", m.ID, m.Date)
err := demoLoader.LoadDemo(&csgo.Demo{MatchId: m.ID, ShareCode: m.ShareCode})
if err != nil {
log.Warningf("[HK] Failure trying to parse match %d: %v", m.ID, err)
}
demoLoader.ParseMapL.Unlock()
}
// check for inconsistent matches