1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-21 12:44:49 -05:00

Cache ctxUser in retrieveFeeds(..) (#826)

This commit is contained in:
Ethan Koenig 2017-02-03 00:27:10 -05:00 committed by Lunny Xiao
parent bf6f61cc69
commit 400b6fd61c

View file

@ -65,7 +65,9 @@ func retrieveFeeds(ctx *context.Context, ctxUser *models.User, userID, offset in
// Check access of private repositories. // Check access of private repositories.
feeds := make([]*models.Action, 0, len(actions)) feeds := make([]*models.Action, 0, len(actions))
unameAvatars := make(map[string]string) unameAvatars := map[string]string{
ctxUser.Name: ctxUser.RelAvatarLink(),
}
for _, act := range actions { for _, act := range actions {
// Cache results to reduce queries. // Cache results to reduce queries.
_, ok := unameAvatars[act.ActUserName] _, ok := unameAvatars[act.ActUserName]