moved some hardcoded values to config

This commit is contained in:
2021-10-27 10:29:51 +02:00
parent 9019a19369
commit 25b153900f
4 changed files with 41 additions and 11 deletions

View File

@@ -449,9 +449,14 @@ func (d *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
// clear cache for player
for _, p := range players {
// TODO: cache only real meta stats in only one key
_ = d.cache.Delete(context.Background(), fmt.Sprintf(utils.SideMetaCacheKey, p.ID, 4))
_ = d.cache.Delete(context.Background(), fmt.Sprintf(utils.MatchMetaCacheKey, p.ID))
err = d.cache.Delete(context.Background(), fmt.Sprintf(utils.SideMetaCacheKey, p.ID))
if err != nil {
log.Warningf("[DL] Unable to delete cache key %s: %v", fmt.Sprintf(utils.SideMetaCacheKey, p.ID), err)
}
err = d.cache.Delete(context.Background(), fmt.Sprintf(utils.MatchMetaCacheKey, p.ID))
if err != nil {
log.Warningf("[DL] Unable to delete cache key %s: %v", fmt.Sprintf(utils.MatchMetaCacheKey, p.ID), err)
}
}
err = d.dp.ParseDemo(demo)