Skip to content

Commit 400b6fd

Browse files
ethantkoeniglunny
authored andcommitted
Cache ctxUser in retrieveFeeds(..) (#826)
1 parent bf6f61c commit 400b6fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

routers/user/home.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ func retrieveFeeds(ctx *context.Context, ctxUser *models.User, userID, offset in
6565

6666
// Check access of private repositories.
6767
feeds := make([]*models.Action, 0, len(actions))
68-
unameAvatars := make(map[string]string)
68+
unameAvatars := map[string]string{
69+
ctxUser.Name: ctxUser.RelAvatarLink(),
70+
}
6971
for _, act := range actions {
7072
// Cache results to reduce queries.
7173
_, ok := unameAvatars[act.ActUserName]

0 commit comments

Comments
 (0)