Limit number of timeline items with SQL

This commit is contained in:
Asaf Gartner 2024-07-06 12:01:08 +03:00
parent 3a492059de
commit df0e57f4cc
1 changed files with 1 additions and 2 deletions

View File

@ -308,13 +308,12 @@ func ProjectHomepage(c *RequestContext) ResponseData {
templateData.RecentActivity, err = FetchTimeline(c, c.Conn, c.CurrentUser, lineageBuilder, hmndata.TimelineQuery{ templateData.RecentActivity, err = FetchTimeline(c, c.Conn, c.CurrentUser, lineageBuilder, hmndata.TimelineQuery{
ProjectIDs: []int{c.CurrentProject.ID}, ProjectIDs: []int{c.CurrentProject.ID},
Limit: maxRecentActivity,
}) })
if err != nil { if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err) return c.ErrorResponse(http.StatusInternalServerError, err)
} }
templateData.RecentActivity = utils.ClampSlice(templateData.RecentActivity, maxRecentActivity)
followUrl := "" followUrl := ""
following := false following := false
if c.CurrentUser != nil { if c.CurrentUser != nil {