summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-06-07 22:11:41 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-08 10:11:41 +0800
commit9ddc35e343d6789df694b64e86b52183ce077530 (patch)
tree7bab9168d1a7afe3f381900ac540420182018939 /routers/user
parentff7424179ecad0f6c33246be82dafeacd1ee875c (diff)
downloadgitea-9ddc35e343d6789df694b64e86b52183ce077530.tar.gz
gitea-9ddc35e343d6789df694b64e86b52183ce077530.zip
Cache ctx.User in retrieveFeeds (#1902)
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 0db170bfd8..7f6396ebd1 100644
--- a/routers/user/home.go
+++ b/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.