refactored some functions, added demo download retry
This commit is contained in:
@@ -21,9 +21,6 @@ type Demo struct {
|
||||
ShareCode string
|
||||
MatchId uint64
|
||||
Url string
|
||||
Rank int
|
||||
Tickrate int
|
||||
File string
|
||||
}
|
||||
|
||||
type DemoParser struct {
|
||||
@@ -128,14 +125,7 @@ func (p *DemoParser) parseWorker() {
|
||||
if err != nil {
|
||||
switch e := err.(type) {
|
||||
case DemoNotFoundError:
|
||||
p.lock.Lock()
|
||||
err := tMatch.Update().SetDemoExpired(true).Exec(context.Background())
|
||||
p.lock.Unlock()
|
||||
if err != nil {
|
||||
log.Errorf("[DP] Unable to set demo expire for match %d: %v", demo.MatchId, e)
|
||||
continue
|
||||
}
|
||||
log.Warningf("[DP] Demo already expired for %d", demo.MatchId)
|
||||
log.Warningf("[DP] Demo not found for %d. Maybe temp.?", demo.MatchId)
|
||||
continue
|
||||
default:
|
||||
log.Warningf("[DP] Unable to download demo for %d: %v", demo.MatchId, e)
|
||||
|
Reference in New Issue
Block a user