fixed module path; added translate endpoint to chat API

This commit is contained in:
2022-02-12 01:18:29 +01:00
parent 440aa41396
commit f2a859d084
56 changed files with 256 additions and 184 deletions

View File

@@ -2,9 +2,9 @@ package csgo
import (
"context"
"csgowtfd/ent"
"csgowtfd/utils"
"fmt"
"git.harting.dev/csgowtf/csgowtfd/ent"
"git.harting.dev/csgowtf/csgowtfd/utils"
"github.com/an0nfunc/go-steam/v3"
"github.com/an0nfunc/go-steam/v3/csgo/protocol/protobuf"
"github.com/an0nfunc/go-steam/v3/netutil"
@@ -356,16 +356,11 @@ func (dml *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
}
iMatch, err := dml.db.Match.Get(context.Background(), matchId)
if err != nil {
switch e := err.(type) {
case *ent.NotFoundError:
break
default:
log.Errorf("[DL] Failure trying to lookup match %d in db: %v", matchId, e)
dml.unlockDemo(demo)
continue
}
} else {
if err != nil && !ent.IsNotFound(err) {
log.Errorf("[DL] Failure trying to lookup match %d in db: %v", matchId, err)
dml.unlockDemo(demo)
continue
} else if err == nil {
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.", iMatch.ID)
demo.MatchId = matchId