Compare commits

..

1 Commits

Author SHA1 Message Date
Helzoph
ab92e19725
Merge 832b4b3908 into 8e20875453 2024-09-19 01:53:29 +00:00
2 changed files with 3 additions and 0 deletions

1
cache/account.go vendored
View File

@ -58,6 +58,7 @@ func UpdateAccountLastActivity(uuid []byte) bool {
return err == nil
}
// FIXME: This is not atomic
func UpdateAccountStats(uuid []byte, battles, classicSessionsPlayed int) bool {
rdb.Do("SELECT", accountsDB)
err := rdb.HIncrBy(string(uuid), "battles", int64(battles)).Err()

2
cache/game.go vendored
View File

@ -27,6 +27,7 @@ func FetchPlayerCount() (int, bool) {
return int(cachedPlayerCount), true
}
// FIXME: This is not working
func FetchBattleCount() (int, bool) {
rdb.Do("SELECT", accountsDB)
cachedBattleCount, err := rdb.Get("battleCount").Int()
@ -43,6 +44,7 @@ func UpdateBattleCount(battleCount int) bool {
return err == nil
}
// FIXME: This is not working
func FetchClassicSessionCount() (int, bool) {
rdb.Do("SELECT", accountsDB)
cachedClassicSessionCount, err := rdb.Get("classicSessionCount").Int()