appdata-debug-3

This commit is contained in:
Untone 2024-03-02 10:12:05 +03:00
parent 3246d32a23
commit 040f7ead7e

View File

@ -228,8 +228,10 @@ type UserProfile struct {
// GetUserAppDataFromRedis retrieves user profile and follows from Redis, combines them into a JSON format, // GetUserAppDataFromRedis retrieves user profile and follows from Redis, combines them into a JSON format,
// and assigns the JSON string to the provided user's ID. // and assigns the JSON string to the provided user's ID.
func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) { func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) {
// Retrieve user data from Redis userProfileString, err := c.store.Get(c.ctx, fmt.Sprintf(`user:%s:author`, userId)).Result()
userProfileString := c.store.Get(c.ctx, fmt.Sprintf(`user:%s:author`, userId)) if err != nil {
return "", err
}
// Parse userProfileString into a UserProfile struct // Parse userProfileString into a UserProfile struct
var userProfile UserProfile var userProfile UserProfile