fixed lang being wrongly used

This commit is contained in:
2022-02-12 02:53:38 +01:00
parent ede3b58f7e
commit 47fce4fc1a

View File

@@ -687,7 +687,7 @@ func getMatchChat(w http.ResponseWriter, r *http.Request) {
} }
resp := map[string][]*utils.ChatResponse{} resp := map[string][]*utils.ChatResponse{}
err = rdc.Get(context.Background(), fmt.Sprintf(utils.MatchChatCacheKey, matchId, lang), &resp) err = rdc.Get(context.Background(), fmt.Sprintf(utils.MatchChatCacheKey, matchId, lang.String()), &resp)
if err != nil { if err != nil {
tStats, err := db.Messages.Query().Where(messages.HasMatchPlayerWith(matchplayer.HasMatchesWith(match.ID(matchId)))).WithMatchPlayer().All(context.Background()) tStats, err := db.Messages.Query().Where(messages.HasMatchPlayerWith(matchplayer.HasMatchesWith(match.ID(matchId)))).WithMatchPlayer().All(context.Background())
if err != nil { if err != nil {
@@ -734,7 +734,7 @@ func getMatchChat(w http.ResponseWriter, r *http.Request) {
err = rdc.Set(&cache.Item{ err = rdc.Set(&cache.Item{
Ctx: context.Background(), Ctx: context.Background(),
Key: fmt.Sprintf(utils.MatchChatCacheKey, matchId, lang), Key: fmt.Sprintf(utils.MatchChatCacheKey, matchId, lang.String()),
Value: resp, Value: resp,
TTL: time.Hour * 24 * 30, TTL: time.Hour * 24 * 30,
}) })