diff --git a/server/memorystore/providers/redis/store.go b/server/memorystore/providers/redis/store.go index 6609673..2129956 100644 --- a/server/memorystore/providers/redis/store.go +++ b/server/memorystore/providers/redis/store.go @@ -231,10 +231,13 @@ type AuthorProfile struct { // and assigns the JSON string to the provided user's ID. func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) { // Получаем ID автора из Redis - authorIdString, err := c.store.Get(c.ctx, fmt.Sprintf("author:user:%s", userId)).Result() + rkey := fmt.Sprintf("author:user:%s", userId) + fmt.Println("get redis cached by key:", rkey) + authorIdString, err := c.store.Get(c.ctx, rkey).Result() if err != nil { return "", err } + fmt.Println("redis found string value:", authorIdString) // Преобразуем ID автора из строки в int var authorIdFloat float64 @@ -243,6 +246,7 @@ func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) { return "", err } authorId := int(authorIdFloat) + fmt.Println("recognized author id: ", authorId) // Получаем профиль автора из Redis authorProfileString, err := c.store.Get(c.ctx, fmt.Sprintf("author:id:%d", authorId)).Result()