This commit is contained in:
parent
871c65b9dd
commit
0f9b95cafe
|
@ -107,7 +107,7 @@ func SessionResolver(ctx context.Context, params *model.SessionQueryInput) (*mod
|
|||
redisURL := os.Getenv(constants.EnvKeyRedisURL)
|
||||
if redisURL != "" {
|
||||
log.Info("Initializing Redis provider")
|
||||
Provider, _ := redis.NewRedisProvider(redisURL)
|
||||
Provider, err := redis.NewRedisProvider(redisURL)
|
||||
if err != nil {
|
||||
log.Debug("Failed to init Redis: ", err)
|
||||
}
|
||||
|
@ -120,14 +120,22 @@ func SessionResolver(ctx context.Context, params *model.SessionQueryInput) (*mod
|
|||
if err != nil {
|
||||
log.Debug("Failed to get follows from Redis: ", err)
|
||||
} else {
|
||||
if follows != "" {
|
||||
res.User.AppData["follows"] = follows
|
||||
} else {
|
||||
log.Debug("Follows data from Redis is empty")
|
||||
}
|
||||
}
|
||||
|
||||
author, err := Provider.GetUserProfile(userID)
|
||||
if err != nil {
|
||||
log.Debug("Failed to get author from Redis: ", err)
|
||||
} else {
|
||||
if author != "" {
|
||||
res.User.AppData["author"] = author
|
||||
} else {
|
||||
log.Debug("Author data from Redis is empty")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user