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