moved spray timeout to config
This commit is contained in:
26
main.go
26
main.go
@@ -34,6 +34,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//goland:noinspection ALL
|
||||
var (
|
||||
conf = utils.Conf{}
|
||||
demoLoader = &csgo.DemoMatchLoader{}
|
||||
@@ -42,7 +43,7 @@ var (
|
||||
rdb *redis.Client
|
||||
rdc *cache.Cache
|
||||
rL ratelimit.Limiter
|
||||
configFlag = flag.String("config", "config.yaml", "Set config to use")
|
||||
configFlag = flag.String("config", "config.yaml", "Set config file to use")
|
||||
journalLogFlag = flag.Bool("journal", false, "Log to systemd journal instead of stdout")
|
||||
sqlDebugFlag = flag.Bool("sqldebug", false, "Debug SQL queries")
|
||||
)
|
||||
@@ -695,7 +696,7 @@ func getMatch(w http.ResponseWriter, r *http.Request) {
|
||||
Stats: []*utils.StatsResponse{},
|
||||
}
|
||||
|
||||
if tMatch.Date.After(time.Now().AddDate(0, 0, -30)) {
|
||||
if tMatch.Date.After(time.Now().AddDate(0, 0, -1*conf.Csgowtfd.DemosExpire)) {
|
||||
mResponse.ReplayURL = tMatch.ReplayURL
|
||||
}
|
||||
|
||||
@@ -850,16 +851,17 @@ func main() {
|
||||
|
||||
// setup GC
|
||||
err = demoLoader.Setup(&csgo.DemoMatchLoaderConfig{
|
||||
Username: conf.Steam.Username,
|
||||
Password: conf.Steam.Password,
|
||||
AuthCode: conf.Steam.AuthCode,
|
||||
Sentry: conf.Steam.Sentry,
|
||||
LoginKey: conf.Steam.LoginKey,
|
||||
Db: db,
|
||||
Worker: conf.Parser.Worker,
|
||||
ApiKey: conf.Steam.APIKey,
|
||||
RateLimit: rL,
|
||||
Cache: rdc,
|
||||
Username: conf.Steam.Username,
|
||||
Password: conf.Steam.Password,
|
||||
AuthCode: conf.Steam.AuthCode,
|
||||
Sentry: conf.Steam.Sentry,
|
||||
LoginKey: conf.Steam.LoginKey,
|
||||
Db: db,
|
||||
Worker: conf.Parser.Worker,
|
||||
ApiKey: conf.Steam.APIKey,
|
||||
RateLimit: rL,
|
||||
Cache: rdc,
|
||||
SprayTimeout: conf.Csgowtfd.SprayTimeout,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("Unbale to setup DemoLoader: %v", err)
|
||||
|
Reference in New Issue
Block a user