mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 10:34:07 +01:00
Cache ctx.User in retrieveFeeds (#1902)
This commit is contained in:
parent
ff7424179e
commit
9ddc35e343
1 changed files with 3 additions and 0 deletions
|
@ -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…
Reference in a new issue