prevent HK from trying to reparse while parsing is in progress
This commit is contained in:
7
main.go
7
main.go
@@ -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
|
||||
|
Reference in New Issue
Block a user