DataCache and changes for game update
Recent game update changed pokememes view in pokedeks, so we need to reflect it by updating parser. Introducing DataCache - a silver bullet for eliminating lags linked to database queries. Less queries, more in RAM, faster work. Needs testing in production environment.
This commit is contained in:
@@ -144,13 +144,13 @@ func (s *Squader) GetUserRolesInSquads(playerRaw *dbmapping.Player) ([]dbmapping
|
||||
for i := range userRolesRaw {
|
||||
userRoleFull := dbmapping.SquadPlayerFull{}
|
||||
userRoleFull.Player = *playerRaw
|
||||
userProfile, profileOk := c.Users.GetProfile(playerRaw.ID)
|
||||
userRoleFull.Profile = userProfile
|
||||
userProfile, profileError := c.DataCache.GetProfileByPlayerID(playerRaw.ID)
|
||||
userRoleFull.Profile = *userProfile
|
||||
userRoleFull.UserRole = userRolesRaw[i].UserType
|
||||
squad, squadOk := s.GetSquadByID(userRolesRaw[i].SquadID)
|
||||
userRoleFull.Squad = squad
|
||||
|
||||
if profileOk && squadOk {
|
||||
if profileError == nil && squadOk {
|
||||
userRoles = append(userRoles, userRoleFull)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user