Cache ctx.User in retrieveFeeds (#1902)

tokarchuk/v1.17
Ethan Koenig 8 years ago committed by Lunny Xiao
parent ff7424179e
commit 9ddc35e343
  1. 3
      routers/user/home.go

@ -67,6 +67,9 @@ func retrieveFeeds(ctx *context.Context, user *models.User, includePrivate, isPr
}
userCache := map[int64]*models.User{user.ID: user}
if ctx.User != nil {
userCache[ctx.User.ID] = ctx.User
}
repoCache := map[int64]*models.Repository{}
for _, act := range actions {
// Cache results to reduce queries.

Loading…
Cancel
Save