From 47fce4fc1a7881354e305a0495c722a56ef206ba Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Sat, 12 Feb 2022 02:53:38 +0100 Subject: [PATCH] fixed lang being wrongly used --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index d02cf0c..cbf60e2 100644 --- a/main.go +++ b/main.go @@ -687,7 +687,7 @@ func getMatchChat(w http.ResponseWriter, r *http.Request) { } 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 { tStats, err := db.Messages.Query().Where(messages.HasMatchPlayerWith(matchplayer.HasMatchesWith(match.ID(matchId)))).WithMatchPlayer().All(context.Background()) if err != nil { @@ -734,7 +734,7 @@ func getMatchChat(w http.ResponseWriter, r *http.Request) { err = rdc.Set(&cache.Item{ Ctx: context.Background(), - Key: fmt.Sprintf(utils.MatchChatCacheKey, matchId, lang), + Key: fmt.Sprintf(utils.MatchChatCacheKey, matchId, lang.String()), Value: resp, TTL: time.Hour * 24 * 30, })